AnswerOptions structure describes the options used to control the answer
creation process.OfferAnswerOptionsOfferAnswerOptions VoiceActivityDetection allows the application to provide information
about whether it wishes voice detection feature to be enabled or disabled.
func (*PeerConnection).CreateAnswer(*AnswerOptions) (SessionDescription, error)
API allows configuration of a PeerConnection
with APIs that are available in the standard. This
lets you set custom behavior via the SettingEngine, configure
codecs via the MediaEngine and define custom media behaviors via
Interceptors. NewDTLSTransport creates a new DTLSTransport.
This constructor is part of the ORTC API. It is not
meant to be used together with the basic WebRTC API. NewDataChannel creates a new DataChannel.
This constructor is part of the ORTC API. It is not
meant to be used together with the basic WebRTC API. NewICEGatherer creates a new NewICEGatherer.
This constructor is part of the ORTC API. It is not
meant to be used together with the basic WebRTC API. NewICETransport creates a new NewICETransport.
This constructor is part of the ORTC API. It is not
meant to be used together with the basic WebRTC API. NewPeerConnection creates a new PeerConnection with the provided configuration against the received API object.
This method will attach a default set of codecs and interceptors to
the resulting PeerConnection. If this behavior is not desired,
set the set of codecs and interceptors explicitly by using
[WithMediaEngine] and [WithInterceptorRegistry] when calling [NewAPI]. NewRTPReceiver constructs a new RTPReceiver. NewRTPSender constructs a new RTPSender. NewSCTPTransport creates a new SCTPTransport.
This constructor is part of the ORTC API. It is not
meant to be used together with the basic WebRTC API.
func NewAPI(options ...func(*API)) *API
AudioPlayoutStats represents one playout path - if the same playout stats object is referenced by multiple
RTCInboundRtpStreamStats this is an indication that audio mixing is happening in which case sample counters in this
stats object refer to the samples after mixing. Only applicable if the playout path represents an audio device. ID is a unique id that is associated with the component inspected to produce
this Stats object. Two Stats objects will have the same ID if they were produced
by inspecting the same underlying object. Kind is "audio" SynthesizedSamplesDuration is measured in seconds and is incremented each time an audio sample is synthesized by
this playout path. This metric can be used together with totalSamplesDuration to calculate the percentage of played
out media being synthesized. If the playout path is unable to produce audio samples on time for device playout,
samples are synthesized to be playout out instead. Synthesization typically only happens if the pipeline is
underperforming. Samples synthesized by the RTCInboundRtpStreamStats are not counted for here, but in
InboundRtpStreamStats.concealedSamples. SynthesizedSamplesEvents is the number of synthesized samples events. This counter increases every time a sample
is synthesized after a non-synthesized sample. That is, multiple consecutive synthesized samples will increase
synthesizedSamplesDuration multiple times but is a single synthesization samples event. Timestamp is the timestamp associated with this object. When audio samples are pulled by the playout device, this counter is incremented with the estimated delay of the
playout path for that audio sample. The playout delay includes the delay from being emitted to the actual time of
playout on the device. This metric can be used together with totalSamplesCount to calculate the average
playout delay per sample. When audio samples are pulled by the playout device, this counter is incremented with the number of samples
emitted for playout. TotalSamplesDuration represents the total duration in seconds of all samples
that have sent or received (and thus counted by TotalSamplesSent or TotalSamplesReceived).
Can be used with TotalAudioEnergy to compute an average audio level over different intervals. Type is the object's StatsType
AudioPlayoutStats : Stats
AudioReceiverStats contains audio metrics related to a specific receiver. AudioLevel represents the output audio level of the track.
The value is a value between 0..1 (linear), where 1.0 represents 0 dBov,
0 represents silence, and 0.5 represents approximately 6 dBSPL change in
the sound pressure level from 0 dBov.
If the track is sourced from an Receiver, does no audio processing, has a
constant level, and has a volume setting of 1.0, the audio level is expected
to be the same as the audio level of the source SSRC, while if the volume setting
is 0.5, the AudioLevel is expected to be half that value.
For outgoing audio tracks, the AudioLevel is the level of the audio being sent. ConcealedSamples is the total number of samples that are concealed samples.
A concealed sample is a sample that is based on data that was synthesized
to conceal packet loss and does not represent incoming data. ConcealmentEvents is the number of concealment events. This counter increases
every time a concealed sample is synthesized after a non-concealed sample.
That is, multiple consecutive concealed samples will increase the concealedSamples
count multiple times but is a single concealment event. EstimatedPlayoutTimestamp is the estimated playout time of this receiver's
track. The playout time is the NTP timestamp of the last playable sample that
has a known timestamp (from an RTCP SR packet mapping RTP timestamps to NTP
timestamps), extrapolated with the time elapsed since it was ready to be played out.
This is the "current time" of the track in NTP clock time of the sender and
can be present even if there is no audio currently playing.
This can be useful for estimating how much audio and video is out of
sync for two tracks from the same source:
AudioTrackStats.EstimatedPlayoutTimestamp - VideoTrackStats.EstimatedPlayoutTimestamp ID is a unique id that is associated with the component inspected to produce
this Stats object. Two Stats objects will have the same ID if they were produced
by inspecting the same underlying object. JitterBufferDelay is the sum of the time, in seconds, each sample takes from
the time it is received and to the time it exits the jitter buffer.
This increases upon samples exiting, having completed their time in the buffer
(incrementing JitterBufferEmittedCount). The average jitter buffer delay can
be calculated by dividing the JitterBufferDelay with the JitterBufferEmittedCount. JitterBufferEmittedCount is the total number of samples that have come out
of the jitter buffer (increasing JitterBufferDelay). Kind is "audio" Timestamp is the timestamp associated with this object. TotalAudioEnergy is the total energy of all the audio samples sent/received
for this object, calculated by duration * Math.pow(energy/maxEnergy, 2) for
each audio sample seen. TotalSamplesDuration represents the total duration in seconds of all samples
that have sent or received (and thus counted by TotalSamplesSent or TotalSamplesReceived).
Can be used with TotalAudioEnergy to compute an average audio level over different intervals. TotalSamplesReceived is the total number of samples that have been received
by this receiver. This includes ConcealedSamples. Type is the object's StatsType VoiceActivityFlag represents whether the last RTP packet sent or played out
by this track contained voice activity or not based on the presence of the
V bit in the extension header, as defined in [RFC6464].
This value indicates the voice activity in the latest RTP packet played out
from a given SSRC, and is defined in RTPSynchronizationSource.voiceActivityFlag.
AudioReceiverStats : Stats
AudioSenderStats represents the stats about one audio sender of a PeerConnection
object for which one calls GetStats.
It appears in the stats as soon as the RTPSender is added by either AddTrack
or AddTransceiver, or by media negotiation. AudioLevel represents the output audio level of the track.
The value is a value between 0..1 (linear), where 1.0 represents 0 dBov,
0 represents silence, and 0.5 represents approximately 6 dBSPL change in
the sound pressure level from 0 dBov.
If the track is sourced from an Receiver, does no audio processing, has a
constant level, and has a volume setting of 1.0, the audio level is expected
to be the same as the audio level of the source SSRC, while if the volume setting
is 0.5, the AudioLevel is expected to be half that value.
For outgoing audio tracks, the AudioLevel is the level of the audio being sent. EchoReturnLoss is only present while the sender is sending a track sourced from
a microphone where echo cancellation is applied. Calculated in decibels. EchoReturnLossEnhancement is only present while the sender is sending a track
sourced from a microphone where echo cancellation is applied. Calculated in decibels. Ended reflects the "ended" state of the track. ID is a unique id that is associated with the component inspected to produce
this Stats object. Two Stats objects will have the same ID if they were produced
by inspecting the same underlying object. Kind is "audio" RemoteSource is true if the source is remote, for instance if it is sourced
from another host via a PeerConnection. False otherwise. Only applicable for 'track' stats. Timestamp is the timestamp associated with this object. TotalAudioEnergy is the total energy of all the audio samples sent/received
for this object, calculated by duration * Math.pow(energy/maxEnergy, 2) for
each audio sample seen. TotalSamplesDuration represents the total duration in seconds of all samples
that have sent or received (and thus counted by TotalSamplesSent or TotalSamplesReceived).
Can be used with TotalAudioEnergy to compute an average audio level over different intervals. TotalSamplesSent is the total number of samples that have been sent by this sender. TrackIdentifier represents the id property of the track. Type is the object's StatsType VoiceActivityFlag represents whether the last RTP packet sent or played out
by this track contained voice activity or not based on the presence of the
V bit in the extension header, as defined in [RFC6464].
This value indicates the voice activity in the latest RTP packet played out
from a given SSRC, and is defined in RTPSynchronizationSource.voiceActivityFlag.
AudioSenderStats : Stats
AudioSourceStats represents an audio track that is attached to one or more senders. AudioLevel represents the output audio level of the track.
The value is a value between 0..1 (linear), where 1.0 represents 0 dBov,
0 represents silence, and 0.5 represents approximately 6 dBSPL change in
the sound pressure level from 0 dBov.
If the track is sourced from an Receiver, does no audio processing, has a
constant level, and has a volume setting of 1.0, the audio level is expected
to be the same as the audio level of the source SSRC, while if the volume setting
is 0.5, the AudioLevel is expected to be half that value. DroppedSamplesDuration represents the total duration, in seconds, of samples produced by the device that got
dropped before reaching the media source. Only applicable if this media source is backed by an audio capture device. DroppedSamplesEvents is the number of dropped samples events. This counter increases every time a sample is
dropped after a non-dropped sample. That is, multiple consecutive dropped samples will increase
droppedSamplesDuration multiple times but is a single dropped samples event. EchoReturnLoss is only present while the sender is sending a track sourced from
a microphone where echo cancellation is applied. Calculated in decibels. EchoReturnLossEnhancement is only present while the sender is sending a track
sourced from a microphone where echo cancellation is applied. Calculated in decibels. ID is a unique id that is associated with the component inspected to produce
this Stats object. Two Stats objects will have the same ID if they were produced
by inspecting the same underlying object. Kind is "audio" Timestamp is the timestamp associated with this object. TotalAudioEnergy is the total energy of all the audio samples sent/received
for this object, calculated by duration * Math.pow(energy/maxEnergy, 2) for
each audio sample seen. TotalCaptureDelay is the total delay, in seconds, for each audio sample between the time the sample was emitted
by the capture device and the sample reaching the source. This can be used together with totalSamplesCaptured to
calculate the average capture delay per sample.
Only applicable if the audio source represents an audio capture device. TotalSamplesCaptured is the total number of captured samples reaching the audio source, i.e. that were not dropped
by the capture pipeline. The frequency of the media source is not necessarily the same as the frequency of encoders
later in the pipeline. Only applicable if the audio source represents an audio capture device. TotalSamplesDuration represents the total duration in seconds of all samples
that have sent or received (and thus counted by TotalSamplesSent or TotalSamplesReceived).
Can be used with TotalAudioEnergy to compute an average audio level over different intervals. TrackIdentifier represents the id property of the track. Type is the object's StatsType
AudioSourceStats : Stats
BundlePolicy affects which media tracks are negotiated if the remote
endpoint is not bundle-aware, and what ICE candidates are gathered. If the
remote endpoint is bundle-aware, all media tracks and data channels are
bundled onto the same transport. MarshalJSON returns the JSON encoding.( BundlePolicy) String() string UnmarshalJSON parses the JSON-encoded data and stores the result.
BundlePolicy : github.com/goccy/go-json.Marshaler
*BundlePolicy : github.com/goccy/go-json.Unmarshaler
BundlePolicy : encoding/json.Marshaler
*BundlePolicy : encoding/json.Unmarshaler
BundlePolicy : expvar.Var
BundlePolicy : fmt.Stringer
const BundlePolicyBalanced
const BundlePolicyMaxBundle
const BundlePolicyMaxCompat
const BundlePolicyUnknown
CertificateStats contains information about a certificate used by an ICETransport. Base64Certificate is the DER-encoded base-64 representation of the certificate. Fingerprint is the fingerprint of the certificate. FingerprintAlgorithm is the hash function used to compute the certificate fingerprint. For instance, "sha-256". ID is a unique id that is associated with the component inspected to produce
this Stats object. Two Stats objects will have the same ID if they were produced
by inspecting the same underlying object. IssuerCertificateID refers to the stats object that contains the next certificate
in the certificate chain. If the current certificate is at the end of the chain
(i.e. a self-signed certificate), this will not be set. Timestamp is the timestamp associated with this object. Type is the object's StatsType
CertificateStats : Stats
func StatsReport.GetCertificateStats(c *Certificate) (CertificateStats, bool)
CodecStats contains statistics for a codec that is currently being used by RTP streams
being sent or received by this PeerConnection object. Channels is 2 for stereo, missing for most other cases. ClockRate represents the media sampling rate. CodecType of this CodecStats ID is a unique id that is associated with the component inspected to produce
this Stats object. Two Stats objects will have the same ID if they were produced
by inspecting the same underlying object. Implementation identifies the implementation used. This is useful for diagnosing
interoperability issues. MimeType is the codec MIME media type/subtype. e.g., video/vp8 or equivalent. PayloadType as used in RTP encoding or decoding SDPFmtpLine is the a=fmtp line in the SDP corresponding to the codec,
i.e., after the colon following the PT. Timestamp is the timestamp associated with this object. TransportID is the unique identifier of the transport on which this codec is
being used, which can be used to look up the corresponding TransportStats object. Type is the object's StatsType
CodecStats : Stats
func StatsReport.GetCodecStats(c *RTPCodecParameters) (CodecStats, bool)
CodecType specifies whether a CodecStats objects represents a media format
that is being encoded or decoded.
const CodecTypeDecode
const CodecTypeEncode
A Configuration defines how peer-to-peer communication via PeerConnection
is established or re-established.
Configurations may be set up once and reused across multiple connections.
Configurations are treated as readonly. As long as they are unmodified,
they are safe for concurrent use. BundlePolicy indicates which media-bundling policy to use when gathering
ICE candidates. Certificates describes a set of certificates that the PeerConnection
uses to authenticate. Valid values for this parameter are created
through calls to the GenerateCertificate function. Although any given
DTLS connection will use only one certificate, this attribute allows the
caller to provide multiple certificates that support different
algorithms. The final certificate will be selected based on the DTLS
handshake, which establishes which certificates are allowed. The
PeerConnection implementation selects which of the certificates is
used for a given connection; how certificates are selected is outside
the scope of this specification. If this value is absent, then a default
set of certificates is generated for each PeerConnection instance. ICECandidatePoolSize describes the size of the prefetched ICE pool. ICEServers defines a slice describing servers available to be used by
ICE, such as STUN and TURN servers. ICETransportPolicy indicates which candidates the ICEAgent is allowed
to use. PeerIdentity sets the target peer identity for the PeerConnection.
The PeerConnection will not establish a connection to a remote peer
unless it can be successfully authenticated with the provided name. RTCPMuxPolicy indicates which rtcp-mux policy to use when gathering ICE
candidates. SDPSemantics controls the type of SDP offers accepted by and
SDP answers generated by the PeerConnection.
func (*PeerConnection).GetConfiguration() Configuration
func NewPeerConnection(configuration Configuration) (*PeerConnection, error)
func (*API).NewPeerConnection(configuration Configuration) (*PeerConnection, error)
func (*PeerConnection).SetConfiguration(configuration Configuration) error
DataChannel represents a WebRTC DataChannel
The DataChannel interface represents a network channel
which can be used for bidirectional peer-to-peer transfers of arbitrary data. BufferedAmount represents the number of bytes of application data
(UTF-8 text and binary data) that have been queued using send(). Even
though the data transmission can occur in parallel, the returned value
MUST NOT be decreased before the current task yielded back to the event
loop to prevent race conditions. The value does not include framing
overhead incurred by the protocol, or buffering done by the operating
system or network hardware. The value of BufferedAmount slot will only
increase with each call to the send() method as long as the ReadyState is
open; however, BufferedAmount does not reset to zero once the channel
closes. BufferedAmountLowThreshold represents the threshold at which the
bufferedAmount is considered to be low. When the bufferedAmount decreases
from above this threshold to equal or below it, the bufferedamountlow
event fires. BufferedAmountLowThreshold is initially zero on each new
DataChannel, but the application may change its value at any time.
The threshold is set to 0 by default. Close Closes the DataChannel. It may be called regardless of whether
the DataChannel object was created by this peer or the remote peer. Detach allows you to detach the underlying datachannel.
This provides an idiomatic API to work with
(`io.ReadWriteCloser` with its `.Read()` and `.Write()` methods,
as opposed to `.Send()` and `.OnMessage`),
however it disables the OnMessage callback.
Before calling Detach you have to enable this behavior by calling
webrtc.DetachDataChannels(). Combining detached and normal data channels
is not supported.
Please refer to the data-channels-detach example and the
pion/datachannel documentation for the correct way to handle the
resulting DataChannel object. DetachWithDeadline allows you to detach the underlying datachannel.
It is the same as Detach but returns a ReadWriteCloserDeadliner. GracefulClose Closes the DataChannel. It may be called regardless of whether
the DataChannel object was created by this peer or the remote peer. It also waits
for any goroutines it started to complete. This is only safe to call outside of
DataChannel callbacks or if in a callback, in its own goroutine. ID represents the ID for this DataChannel. The value is initially
null, which is what will be returned if the ID was not provided at
channel creation time, and the DTLS role of the SCTP transport has not
yet been negotiated. Otherwise, it will return the ID that was either
selected by the script or generated. After the ID is set to a non-null
value, it will not change. Label represents a label that can be used to distinguish this
DataChannel object from other DataChannel objects. Scripts are
allowed to create multiple DataChannel objects with the same label. MaxPacketLifeTime represents the length of the time window (msec) during
which transmissions and retransmissions may occur in unreliable mode. MaxRetransmits represents the maximum number of retransmissions that are
attempted in unreliable mode. Negotiated represents whether this DataChannel was negotiated by the
application (true), or not (false). OnBufferedAmountLow sets an event handler which is invoked when
the number of bytes of outgoing data becomes lower than or equal to the
BufferedAmountLowThreshold. OnClose sets an event handler which is invoked when
the underlying data transport has been closed.
Note: Due to backwards compatibility, there is a chance that
OnClose can be called, even if the GracefulClose is used.
If this is the case for you, you can deregister OnClose
prior to GracefulClose. OnDial sets an event handler which is invoked when the
peer has been dialed, but before said peer has responded. OnError sets an event handler which is invoked when
the underlying data transport cannot be read. OnMessage sets an event handler which is invoked on a binary
message arrival over the sctp transport from a remote peer.
OnMessage can currently receive messages up to 16384 bytes
in size. Check out the detach API if you want to use larger
message sizes. Note that browser support for larger messages
is also limited. OnOpen sets an event handler which is invoked when
the underlying data transport has been established (or re-established). Ordered returns true if the DataChannel is ordered, and false if
out-of-order delivery is allowed. Protocol represents the name of the sub-protocol used with this
DataChannel. ReadyState represents the state of the DataChannel object. Send sends the binary message to the DataChannel peer. SendText sends the text message to the DataChannel peer. SetBufferedAmountLowThreshold is used to update the threshold.
See BufferedAmountLowThreshold(). Transport returns the SCTPTransport instance the DataChannel is sending over.
*DataChannel : github.com/prometheus/common/expfmt.Closer
*DataChannel : io.Closer
func (*API).NewDataChannel(transport *SCTPTransport, params *DataChannelParameters) (*DataChannel, error)
func (*PeerConnection).CreateDataChannel(label string, options *DataChannelInit) (*DataChannel, error)
func StatsReport.GetDataChannelStats(dc *DataChannel) (DataChannelStats, bool)
DataChannelInit can be used to configure properties of the underlying
channel such as data reliability. ID overrides the default selection of ID for this channel. MaxPacketLifeTime limits the time (in milliseconds) during which the
channel will transmit or retransmit data if not acknowledged. This value
may be clamped if it exceeds the maximum value supported. MaxRetransmits limits the number of times a channel will retransmit data
if not successfully delivered. This value may be clamped if it exceeds
the maximum value supported. Negotiated describes if the data channel is created by the local peer or
the remote peer. The default value of false tells the user agent to
announce the channel in-band and instruct the other peer to dispatch a
corresponding DataChannel. If set to true, it is up to the application
to negotiate the channel and create an DataChannel with the same id
at the other peer. Ordered indicates if data is allowed to be delivered out of order. The
default value of true, guarantees that data will be delivered in order. Protocol describes the subprotocol name used for this channel.
func (*PeerConnection).CreateDataChannel(label string, options *DataChannelInit) (*DataChannel, error)
DataChannelMessage represents a message received from the
data channel. IsString will be set to true if the incoming
message is of the string type. Otherwise the message is of
a binary type.Data[]byteIsStringbool
DataChannelStats contains statistics related to each DataChannel ID. BytesReceived represents the total number of bytes received on this
datachannel not including headers or padding. BytesSent represents the total number of payload bytes sent on this
datachannel not including headers or padding. DataChannelIdentifier is the "id" attribute of the DataChannel object. ID is a unique id that is associated with the component inspected to produce
this Stats object. Two Stats objects will have the same ID if they were produced
by inspecting the same underlying object. Label is the "label" value of the DataChannel object. MessagesReceived represents the total number of API "message" events received. MessagesSent represents the total number of API "message" events sent. Protocol is the "protocol" value of the DataChannel object. State is the "readyState" value of the DataChannel object. Timestamp is the timestamp associated with this object. TransportID the ID of the TransportStats object for transport used to carry this datachannel. Type is the object's StatsType
DataChannelStats : Stats
func StatsReport.GetDataChannelStats(dc *DataChannel) (DataChannelStats, bool)
DTLSFingerprint specifies the hash function algorithm and certificate
fingerprint as described in https://tools.ietf.org/html/rfc4572. Algorithm specifies one of the hash function algorithms defined in
the 'Hash function Textual Names' registry. Value specifies the value of the certificate fingerprint in lowercase
hex string as expressed utilizing the syntax of 'fingerprint' in
https://tools.ietf.org/html/rfc4572#section-5.
func Certificate.GetFingerprints() ([]DTLSFingerprint, error)
DTLSTransport allows an application access to information about the DTLS
transport over which RTP and RTCP packets are sent and received by
RTPSender and RTPReceiver, as well other data such as SCTP packets sent
and received by data channels. GetLocalParameters returns the DTLS parameters of the local DTLSTransport upon construction. GetRemoteCertificate returns the certificate chain in use by the remote side
returns an empty list prior to selection of the remote certificate. ICETransport returns the currently-configured *ICETransport or nil
if one has not been configured. OnStateChange sets a handler that is fired when the DTLS
connection state changes. Start DTLS transport negotiation with the parameters of the remote DTLS transport. State returns the current dtls transport state. Stop stops and closes the DTLSTransport object. WriteRTCP sends a user provided RTCP packet to the connected peer. If no peer is connected the
packet is discarded.
func (*API).NewDTLSTransport(transport *ICETransport, certificates []Certificate) (*DTLSTransport, error)
func (*RTPReceiver).Transport() *DTLSTransport
func (*RTPSender).Transport() *DTLSTransport
func (*SCTPTransport).Transport() *DTLSTransport
func (*API).NewRTPReceiver(kind RTPCodecType, transport *DTLSTransport) (*RTPReceiver, error)
func (*API).NewRTPSender(track TrackLocal, transport *DTLSTransport) (*RTPSender, error)
func (*API).NewSCTPTransport(dtls *DTLSTransport) *SCTPTransport
ICECandidatePairStats contains ICE candidate pair statistics related
to the ICETransport objects. AvailableIncomingBitrate is calculated by the underlying congestion control
by combining the available bitrate for all the incoming RTP streams using
this candidate pair. The bitrate measurement does not count the size of the
IP or other transport layers like TCP or UDP. It is similar to the TIAS defined
in RFC 3890, i.e., it is measured in bits per second and the bitrate is
calculated over a 1 second window. AvailableOutgoingBitrate is calculated by the underlying congestion control
by combining the available bitrate for all the outgoing RTP streams using
this candidate pair. The bitrate measurement does not count the size of the
IP or other transport layers like TCP or UDP. It is similar to the TIAS defined
in RFC 3890, i.e., it is measured in bits per second and the bitrate is calculated
over a 1 second window. BytesDiscardedOnSend represents the total number of bytes for this candidate pair
that have been discarded due to socket errors, i.e. a socket error occurred
when handing the packets containing the bytes to the socket. This might happen due
to various reasons, including full buffer or no available memory.
Calculated as defined in [RFC3550] section 6.4.1. BytesReceived represents the total number of payload bytes received on this candidate pair
not including headers or padding. BytesSent represents the total number of payload bytes sent on this candidate pair
not including headers or padding. CircuitBreakerTriggerCount represents the number of times the circuit breaker
is triggered for this particular 5-tuple, ceasing transmission. ConsentExpiredTimestamp represents the timestamp at which the latest valid
STUN binding response expired. ConsentRequestsSent represents the total number of consent requests sent. CurrentRoundTripTime represents the latest round trip time measured in seconds,
computed from both STUN connectivity checks, including those that are sent
for consent verification. FirstRequestReceivedTimestamp represents the timestamp at which the first
connectivity check request was received. FirstRequestTimestamp represents the timestamp at which the first STUN request
was sent on this particular candidate pair. FirstResponseTimestamp represents the timestamp at which the first STUN response
was received on this particular candidate pair. ID is a unique id that is associated with the component inspected to produce
this Stats object. Two Stats objects will have the same ID if they were produced
by inspecting the same underlying object. LastPacketReceivedTimestamp represents the timestamp at which the last packet
was received on this particular candidate pair, excluding STUN packets. LastPacketSentTimestamp represents the timestamp at which the last packet was
sent on this particular candidate pair, excluding STUN packets. LastRequestReceivedTimestamp represents the timestamp at which the last
connectivity check request was received. LastRequestTimestamp represents the timestamp at which the last STUN request
was sent on this particular candidate pair. The average interval between two
consecutive connectivity checks sent can be calculated with
(LastRequestTimestamp - FirstRequestTimestamp) / RequestsSent. LastResponseTimestamp represents the timestamp at which the last STUN response
was received on this particular candidate pair. LocalCandidateID is a unique identifier that is associated to the object
that was inspected to produce the ICECandidateStats for the local candidate
associated with this candidate pair. Nominated is true when this valid pair that should be used for media
if it is the highest-priority one amongst those whose nominated flag is set PacketsDiscardedOnSend retpresents the total number of packets for this candidate pair
that have been discarded due to socket errors, i.e. a socket error occurred
when handing the packets to the socket. This might happen due to various reasons,
including full buffer or no available memory. PacketsReceived represents the total number of packets received on this candidate pair. PacketsSent represents the total number of packets sent on this candidate pair. RemoteCandidateID is a unique identifier that is associated to the object
that was inspected to produce the ICECandidateStats for the remote candidate
associated with this candidate pair. RequestsReceived represents the total number of connectivity check requests
received (including retransmissions). It is impossible for the receiver to
tell whether the request was sent in order to check connectivity or check
consent, so all connectivity checks requests are counted here. RequestsSent represents the total number of connectivity check requests
sent (not including retransmissions). ResponsesReceived represents the total number of connectivity check responses received. ResponsesSent represents the total number of connectivity check responses sent.
Since we cannot distinguish connectivity check requests and consent requests,
all responses are counted. RetransmissionsReceived represents the total number of connectivity check
request retransmissions received. RetransmissionsSent represents the total number of connectivity check
request retransmissions sent. State represents the state of the checklist for the local and remote
candidates in a pair. Timestamp is the timestamp associated with this object. TotalRoundTripTime represents the sum of all round trip time measurements
in seconds since the beginning of the session, based on STUN connectivity
check responses (ResponsesReceived), including those that reply to requests
that are sent in order to verify consent. The average round trip time can
be computed from TotalRoundTripTime by dividing it by ResponsesReceived. TransportID is a unique identifier that is associated to the object that
was inspected to produce the TransportStats associated with this candidate pair. Type is the object's StatsType
ICECandidatePairStats : Stats
func (*ICETransport).GetSelectedCandidatePairStats() (ICECandidatePairStats, bool)
func StatsReport.GetICECandidatePairStats(c *ICECandidatePair) (ICECandidatePairStats, bool)
ICECandidateStats contains ICE candidate statistics related to the ICETransport objects. CandidateType is the "Type" field of the ICECandidate. Deleted is true if the candidate has been deleted/freed. For host candidates,
this means that any network resources (typically a socket) associated with the
candidate have been released. For TURN candidates, this means the TURN allocation
is no longer active.
Only defined for local candidates. For remote candidates, this property is not applicable. ID is a unique id that is associated with the component inspected to produce
this Stats object. Two Stats objects will have the same ID if they were produced
by inspecting the same underlying object. IP is the IP address of the candidate, allowing for IPv4 addresses and
IPv6 addresses, but fully qualified domain names (FQDNs) are not allowed. NetworkType represents the type of network interface used by the base of a
local candidate (the address the ICE agent sends from). Only present for
local candidates; it's not possible to know what type of network interface
a remote candidate is using.
Note:
This stat only tells you about the network interface used by the first "hop";
it's possible that a connection will be bottlenecked by another type of network.
For example, when using Wi-Fi tethering, the networkType of the relevant candidate
would be "wifi", even when the next hop is over a cellular connection.
DEPRECATED. Although it may still work in some browsers, the networkType property was deprecated for
preserving privacy. Port is the port number of the candidate. Priority is the "Priority" field of the ICECandidate. Protocol is one of udp and tcp. RelayProtocol is the protocol used by the endpoint to communicate with the
TURN server. This is only present for local candidates. Valid values for
the TURN URL protocol is one of udp, tcp, or tls. Timestamp is the timestamp associated with this object. TransportID is a unique identifier that is associated to the object that
was inspected to produce the TransportStats associated with this candidate. Type is the object's StatsType URL is the URL of the TURN or STUN server indicated in the that translated
this IP address. It is the URL address surfaced in an PeerConnectionICEEvent.
ICECandidateStats : Stats
func StatsReport.GetICECandidateStats(c *ICECandidate) (ICECandidateStats, bool)
ICECredentialType indicates the type of credentials used to connect to
an ICE server. MarshalJSON returns the JSON encoding.( ICECredentialType) String() string UnmarshalJSON parses the JSON-encoded data and stores the result.
ICECredentialType : github.com/goccy/go-json.Marshaler
*ICECredentialType : github.com/goccy/go-json.Unmarshaler
ICECredentialType : encoding/json.Marshaler
*ICECredentialType : encoding/json.Unmarshaler
ICECredentialType : expvar.Var
ICECredentialType : fmt.Stringer
const ICECredentialTypeOauth
const ICECredentialTypePassword
ICEGatherer gathers local host, server reflexive and relay
candidates, as well as enabling the retrieval of local Interactive
Connectivity Establishment (ICE) parameters which can be
exchanged in signaling. Close prunes all local candidates, and closes the ports. Gather ICE candidates. GetLocalCandidates returns the sequence of valid local candidates associated with the ICEGatherer. GetLocalParameters returns the ICE parameters of the ICEGatherer. GracefulClose prunes all local candidates, and closes the ports. It also waits
for any goroutines it started to complete. This is only safe to call outside of
ICEGatherer callbacks or if in a callback, in its own goroutine. OnLocalCandidate sets an event handler which fires when a new local ICE candidate is available
Take note that the handler will be called with a nil pointer when gathering is finished. OnStateChange fires any time the ICEGatherer changes. State indicates the current state of the ICE gatherer.
*ICEGatherer : github.com/prometheus/common/expfmt.Closer
*ICEGatherer : io.Closer
func (*API).NewICEGatherer(opts ICEGatherOptions) (*ICEGatherer, error)
func NewICETransport(gatherer *ICEGatherer, loggerFactory logging.LoggerFactory) *ICETransport
func (*API).NewICETransport(gatherer *ICEGatherer) *ICETransport
func (*ICETransport).Start(gatherer *ICEGatherer, params ICEParameters, role *ICERole) error
ICEServer describes a single STUN and TURN server that can be used by
the ICEAgent to establish a connection with a peer.Credentialinterface{}CredentialTypeICECredentialTypeURLs[]stringUsernamestring MarshalJSON returns the JSON encoding. UnmarshalJSON parses the JSON-encoded data and stores the result.
ICEServer : github.com/goccy/go-json.Marshaler
*ICEServer : github.com/goccy/go-json.Unmarshaler
ICEServer : encoding/json.Marshaler
*ICEServer : encoding/json.Unmarshaler
ICETransport allows an application access to information about the ICE
transport over which packets are sent and received. AddRemoteCandidate adds a candidate associated with the remote ICETransport. GetLocalParameters returns an IceParameters object which provides information
uniquely identifying the local peer for the duration of the ICE session. GetRemoteParameters returns an IceParameters object which provides information
uniquely identifying the remote peer for the duration of the ICE session. GetSelectedCandidatePair returns the selected candidate pair on which packets are sent
if there is no selected pair nil is returned. GetSelectedCandidatePairStats returns the selected candidate pair stats on which packets are sent
if there is no selected pair empty stats, false is returned to indicate stats not available. GracefulStop irreversibly stops the ICETransport. It also waits
for any goroutines it started to complete. This is only safe to call outside of
ICETransport callbacks or if in a callback, in its own goroutine. OnConnectionStateChange sets a handler that is fired when the ICE
connection state changes. OnSelectedCandidatePairChange sets a handler that is invoked when a new
ICE candidate pair is selected. Role indicates the current role of the ICE transport. SetRemoteCandidates sets the sequence of candidates associated with the remote ICETransport. Start incoming connectivity checks based on its configured role. State returns the current ice transport state. Stop irreversibly stops the ICETransport.
func NewICETransport(gatherer *ICEGatherer, loggerFactory logging.LoggerFactory) *ICETransport
func (*API).NewICETransport(gatherer *ICEGatherer) *ICETransport
func (*DTLSTransport).ICETransport() *ICETransport
func (*API).NewDTLSTransport(transport *ICETransport, certificates []Certificate) (*DTLSTransport, error)
ICETransportPolicy defines the ICE candidate policy surface the
permitted candidates. Only these candidates are used for connectivity checks. MarshalJSON returns the JSON encoding.( ICETransportPolicy) String() string UnmarshalJSON parses the JSON-encoded data and stores the result.
ICETransportPolicy : github.com/goccy/go-json.Marshaler
*ICETransportPolicy : github.com/goccy/go-json.Unmarshaler
ICETransportPolicy : encoding/json.Marshaler
*ICETransportPolicy : encoding/json.Unmarshaler
ICETransportPolicy : expvar.Var
ICETransportPolicy : fmt.Stringer
func NewICETransportPolicy(raw string) ICETransportPolicy
const ICETransportPolicyAll
const ICETransportPolicyRelay
InboundRTPStreamStats contains statistics for an inbound RTP stream that is
currently received with this PeerConnection object. AudioLevel represents the audio level of the receiving track..
The value is a value between 0..1 (linear), where 1.0 represents 0 dBov,
0 represents silence, and 0.5 represents approximately 6 dBSPL change in
the sound pressure level from 0 dBov. Does not exist for video. AverageRTCPInterval is the average RTCP interval between two consecutive compound RTCP packets.
This is calculated by the sending endpoint when sending compound RTCP reports.
Compound packets must contain at least a RTCP RR or SR packet and an SDES packet
with the CNAME item. BurstDiscardCount is the cumulative number of bursts of discarded RTP packets. BurstDiscardRate is the fraction of RTP packets discarded during bursts to
the total number of RTP packets expected in bursts. BurstLossCount is the cumulative number of bursts of lost RTP packets. BurstLossRate is the fraction of RTP packets lost during bursts to the
total number of RTP packets expected in the bursts. BurstPacketsDiscarded is the cumulative number of RTP packets discarded during discard bursts. BurstPacketsLost is the cumulative number of RTP packets lost during loss bursts. BytesReceived is the total number of bytes received for this SSRC. CodecID is a unique identifier that is associated to the object that was inspected
to produce the CodecStats associated with this RTP stream. ConcealedSamples is the total number of samples that are concealed samples.
A concealed sample is a sample that was replaced with synthesized samples generated
locally before being played out. Examples of samples that have to be concealed are
samples from lost packets (reported in packetsLost) or samples from packets that
arrive too late to be played out (reported in packetsDiscarded). Does not exist for video. ConcealmentEvents increases every time a concealed sample is synthesized after
a non-concealed sample. That is, multiple consecutive concealed samples will increase
the concealedSamples count multiple times but is a single concealment event.
Does not exist for video. Identifies the decoder implementation used. This is useful for diagnosing interoperability issues.
Does not exist for audio. FECPacketsDiscarded is the total number of RTP FEC packets received for this SSRC where the
error correction payload was discarded by the application. This may happen
1. if all the source packets protected by the FEC packet were received or already
recovered by a separate FEC packet, or
2. if the FEC packet arrived late, i.e., outside the recovery window, and the
lost RTP packets have already been skipped during playout.
This is a subset of FECPacketsReceived. FECPacketsReceived is the total number of RTP FEC packets received for this SSRC.
This counter can also be incremented when receiving FEC packets in-band with media packets (e.g., with Opus). FIRCount counts the total number of Full Intra Request (FIR) packets received
by the sender. This metric is only valid for video and is sent by receiver. FrameHeight represents the height of the last decoded frame. Before the first
frame is decoded this member does not exist. Does not exist for audio. FrameWidth represents the width of the last decoded frame. Before the first
frame is decoded this member does not exist. Does not exist for audio. FramesDecoded represents the total number of frames correctly decoded for this SSRC,
i.e., frames that would be displayed if no frames are dropped. Only valid for video. FramesDropped is the total number of frames dropped prior to decode or dropped
because the frame missed its display deadline for this receiver's track.
The measurement begins when the receiver is created and is a cumulative metric
as defined in Appendix A (g) of [RFC7004]. Does not exist for audio. FramesReceived represents the total number of complete frames received on this RTP stream.
This metric is incremented when the complete frame is received. Does not exist for audio. FramesRendered represents the total number of frames that have been rendered.
It is incremented just after a frame has been rendered. Does not exist for audio. FreezeCount is the total number of video freezes experienced by this receiver.
It is a freeze if frame duration, which is time interval between two consecutively rendered frames,
is equal or exceeds Max(3 * avg_frame_duration_ms, avg_frame_duration_ms + 150),
where avg_frame_duration_ms is linear average of durations of last 30 rendered frames.
Does not exist for audio. GapDiscardRate is the fraction of RTP packets discarded during the gap periods. GapLossRate is the fraction of RTP packets lost during the gap periods. HeaderBytesReceived is the total number of RTP header and padding bytes received for this SSRC.
This includes retransmissions. This does not include the size of transport layer headers such
as IP or UDP. headerBytesReceived + bytesReceived equals the number of bytes received as
payload over the transport. ID is a unique id that is associated with the component inspected to produce
this Stats object. Two Stats objects will have the same ID if they were produced
by inspecting the same underlying object. InsertedSamplesForDeceleration is increased by the difference between the number of
samples received and the number of samples played out when playout is slowed down.
If playout is slowed down by inserting samples, this will be the number of inserted samples.
Does not exist for video. Jitter is the packet jitter measured in seconds for this SSRC JitterBufferDelay is the sum of the time, in seconds, each audio sample or a video frame
takes from the time the first packet is received by the jitter buffer (ingest timestamp)
to the time it exits the jitter buffer (emit timestamp). The average jitter buffer delay
can be calculated by dividing the JitterBufferDelay with the JitterBufferEmittedCount. JitterBufferEmittedCount is the total number of audio samples or video frames that
have come out of the jitter buffer (increasing jitterBufferDelay). JitterBufferMinimumDelay works the same way as jitterBufferTargetDelay, except that
it is not affected by external mechanisms that increase the jitter buffer target delay,
such as jitterBufferTarget, AV sync, or any other mechanisms. This metric is purely
based on the network characteristics such as jitter and packet loss, and can be seen
as the minimum obtainable jitter buffer delay if no external factors would affect it.
The metric is updated every time JitterBufferEmittedCount is updated. JitterBufferTargetDelay is increased by the target jitter buffer delay every time a sample is emitted
by the jitter buffer. The added target is the target delay, in seconds, at the time that
the sample was emitted from the jitter buffer. To get the average target delay,
divide by JitterBufferEmittedCount KeyFramesDecoded represents the total number of key frames, such as key frames in
VP8 [RFC6386] or IDR-frames in H.264 [RFC6184], successfully decoded for this RTP
media stream. This is a subset of FramesDecoded. FramesDecoded - KeyFramesDecoded
gives you the number of delta frames decoded. Does not exist for audio. Kind is either "audio" or "video" LastPacketReceivedTimestamp represents the timestamp at which the last packet was
received for this SSRC. This differs from Timestamp, which represents the time
at which the statistics were generated by the local endpoint. Mid represents a mid value of RTPTransceiver owning this stream, if that value is not
null. Otherwise, this member is not present. NACKCount counts the total number of Negative ACKnowledgement (NACK) packets
received by the sender and is sent by receiver. PLICount counts the total number of Picture Loss Indication (PLI) packets
received by the sender. This metric is only valid for video and is sent by receiver. PacketsDiscarded is the cumulative number of RTP packets discarded by the jitter
buffer due to late or early-arrival, i.e., these packets are not played out.
RTP packets discarded due to packet duplication are not reported in this metric. PacketsDuplicated is the cumulative number of packets discarded because they
are duplicated. Duplicate packets are not counted in PacketsDiscarded.
Duplicated packets have the same RTP sequence number and content as a previously
received packet. If multiple duplicates of a packet are received, all of them are counted.
An improved estimate of lost packets can be calculated by adding PacketsDuplicated to PacketsLost. PacketsFailedDecryption is the cumulative number of RTP packets that failed
to be decrypted. These packets are not counted by PacketsDiscarded. PacketsLost is the total number of RTP packets lost for this SSRC. Note that
because of how this is estimated, it can be negative if more packets are received than sent. PacketsReceived is the total number of RTP packets received for this SSRC. PacketsRepaired is the cumulative number of lost RTP packets repaired after applying
an error-resilience mechanism. It is measured for the primary source RTP packets
and only counted for RTP packets that have no further chance of repair. PauseCount is the total number of video pauses experienced by this receiver.
Video is considered to be paused if time passed since last rendered frame exceeds 5 seconds.
PauseCount is incremented when a frame is rendered after such a pause. Does not exist for audio. PerDSCPPacketsReceived is the total number of packets received for this SSRC,
per Differentiated Services code point (DSCP) [RFC2474]. DSCPs are identified
as decimal integers in string form. Note that due to network remapping and bleaching,
these numbers are not expected to match the numbers seen on sending. Not all
OSes make this information available. PowerEfficientDecoder indicates whether the decoder currently used is considered power efficient
by the user agent. Does not exist for audio. QPSum is the sum of the QP values of frames passed. The count of frames is
in FramesDecoded for inbound stream stats, and in FramesEncoded for outbound stream stats. ReceiverID is the stats ID used to look up the AudioReceiverStats or VideoReceiverStats
object receiving this stream. RemoteID is used for looking up the remote RemoteOutboundRTPStreamStats object
for the same SSRC. RemovedSamplesForAcceleration is increased by the difference between the number of
samples received and the number of samples played out when playout is sped up. If speedup
is achieved by removing samples, this will be the count of samples removed.
Does not exist for video. SLICount counts the total number of Slice Loss Indication (SLI) packets received
by the sender. This metric is only valid for video and is sent by receiver. SSRC is the 32-bit unsigned integer value used to identify the source of the
stream of RTP packets that this stats object concerns. SilentConcealedSamples is the total number of concealed samples inserted that
are "silent". Playing out silent samples results in silence or comfort noise.
This is a subset of concealedSamples. Does not exist for video. Timestamp is the timestamp associated with this object. TotalAudioEnergy represents the audio energy of the receiving track. It is calculated
by duration * Math.pow(energy/maxEnergy, 2) for each audio sample received (and thus
counted by TotalSamplesReceived). Does not exist for video. TotalDecodeTime is the total number of seconds that have been spent decoding the FramesDecoded
frames of this stream. The average decode time can be calculated by dividing this value
with FramesDecoded. The time it takes to decode one frame is the time passed between
feeding the decoder a frame and the decoder returning decoded data for that frame. TotalFreezesDuration is the total duration of rendered frames which are considered as frozen
(for definition of freeze see freezeCount), in seconds. Does not exist for audio. TotalInterFrameDelay is the sum of the interframe delays in seconds between consecutively
rendered frames, recorded just after a frame has been rendered. The interframe delay variance
be calculated from TotalInterFrameDelay, TotalSquaredInterFrameDelay, and FramesRendered according
to the formula: (TotalSquaredInterFrameDelay - TotalInterFrameDelay^2 / FramesRendered) / FramesRendered.
Does not exist for audio. TotalPausesDuration is the total duration of pauses (for definition of pause see PauseCount), in seconds.
Does not exist for audio. TotalProcessingDelay is the sum of the time, in seconds, each audio sample or video frame
takes from the time the first RTP packet is received (reception timestamp) and to the time
the corresponding sample or frame is decoded (decoded timestamp). At this point the audio
sample or video frame is ready for playout by the MediaStreamTrack. Typically ready for
playout here means after the audio sample or video frame is fully decoded by the decoder. TotalSamplesDuration represents the total duration in seconds of all samples that have been
received (and thus counted by TotalSamplesReceived). Can be used with totalAudioEnergy to
compute an average audio level over different intervals. Does not exist for video. TotalSamplesReceived is the total number of samples that have been received on
this RTP stream. This includes concealedSamples. Does not exist for video. TotalSquaredInterFrameDelay is the sum of the squared interframe delays in seconds
between consecutively rendered frames, recorded just after a frame has been rendered.
See TotalInterFrameDelay for details on how to calculate the interframe delay variance.
Does not exist for audio. TrackID is the identifier of the stats object representing the receiving track,
a ReceiverAudioTrackAttachmentStats or ReceiverVideoTrackAttachmentStats. It is a unique identifier that is associated to the object that was inspected
to produce the TransportStats associated with this RTP stream. Type is the object's StatsType
InboundRTPStreamStats : Stats
MediaStreamStats contains statistics related to a specific MediaStream. ID is a unique id that is associated with the component inspected to produce
this Stats object. Two Stats objects will have the same ID if they were produced
by inspecting the same underlying object. StreamIdentifier is the "id" property of the MediaStream Timestamp is the timestamp associated with this object. TrackIDs is a list of the identifiers of the stats object representing the
stream's tracks, either ReceiverAudioTrackAttachmentStats or ReceiverVideoTrackAttachmentStats. Type is the object's StatsType
MediaStreamStats : Stats
OAuthCredential represents OAuth credential information which is used by
the STUN/TURN client to connect to an ICE server as defined in
https://tools.ietf.org/html/rfc7635. Note that the kid parameter is not
located in OAuthCredential, but in ICEServer's username member. AccessToken is a base64-encoded format. This is an encrypted
self-contained token that is opaque to the application. MACKey is a base64-url encoded format. It is used in STUN message
integrity hash calculation.
OfferAnswerOptions is a base structure which describes the options that
can be used to control the offer/answer creation process. VoiceActivityDetection allows the application to provide information
about whether it wishes voice detection feature to be enabled or disabled.
OfferOptions structure describes the options used to control the offer
creation process. ICERestart forces the underlying ice gathering process to be restarted.
When this value is true, the generated description will have ICE
credentials that are different from the current credentialsOfferAnswerOptionsOfferAnswerOptions VoiceActivityDetection allows the application to provide information
about whether it wishes voice detection feature to be enabled or disabled.
func (*PeerConnection).CreateOffer(options *OfferOptions) (SessionDescription, error)
OutboundRTPStreamStats contains statistics for an outbound RTP stream that is
currently sent with this PeerConnection object. Active indicates whether this RTP stream is configured to be sent or disabled. Note that an
active stream can still not be sending, e.g. when being limited by network conditions. AverageRTCPInterval is the average RTCP interval between two consecutive compound RTCP
packets. This is calculated by the sending endpoint when sending compound RTCP reports.
Compound packets must contain at least a RTCP RR or SR packet and an SDES packet with the CNAME item. BytesDiscardedOnSend is the total number of bytes for this SSRC that have
been discarded due to socket errors, i.e. a socket error occurred when handing
the packets containing the bytes to the socket. This might happen due to various
reasons, including full buffer or no available memory. BytesSent is the total number of bytes sent for this SSRC. CodecID is a unique identifier that is associated to the object that was inspected
to produce the CodecStats associated with this RTP stream. Identifies the encoder implementation used. This is useful for diagnosing interoperability issues.
Does not exist for audio. FECPacketsSent is the total number of RTP FEC packets sent for this SSRC.
This counter can also be incremented when sending FEC packets in-band with
media packets (e.g., with Opus). FIRCount counts the total number of Full Intra Request (FIR) packets received
by the sender. This metric is only valid for video and is sent by receiver. FrameHeight represents the height of the last encoded frame. The resolution of the
encoded frame may be lower than the media source. Before the first frame is encoded
this member does not exist. Does not exist for audio. FrameWidth represents the width of the last encoded frame. The resolution of the
encoded frame may be lower than the media source. Before the first frame is encoded
this member does not exist. Does not exist for audio. FramesEncoded represents the total number of frames successfully encoded for this RTP media stream.
Only valid for video. FramesPerSecond is the number of encoded frames during the last second. This may be
lower than the media source frame rate. Does not exist for audio. FramesSent represents the total number of frames sent on this RTP stream. Does not exist for audio. HeaderBytesSent is the total number of RTP header and padding bytes sent for this SSRC. This does not
include the size of transport layer headers such as IP or UDP.
HeaderBytesSent + BytesSent equals the number of bytes sent as payload over the transport. HugeFramesSent represents the total number of huge frames sent by this RTP stream.
Huge frames, by definition, are frames that have an encoded size at least 2.5 times
the average size of the frames. The average size of the frames is defined as the
target bitrate per second divided by the target FPS at the time the frame was encoded.
These are usually complex to encode frames with a lot of changes in the picture.
This can be used to estimate, e.g slide changes in the streamed presentation.
Does not exist for audio. ID is a unique id that is associated with the component inspected to produce
this Stats object. Two Stats objects will have the same ID if they were produced
by inspecting the same underlying object. KeyFramesEncoded represents the total number of key frames, such as key frames in VP8 [RFC6386] or
IDR-frames in H.264 [RFC6184], successfully encoded for this RTP media stream. This is a subset of
FramesEncoded. FramesEncoded - KeyFramesEncoded gives you the number of delta frames encoded.
Does not exist for audio. Kind is either "audio" or "video" LastPacketSentTimestamp represents the timestamp at which the last packet was
sent for this SSRC. This differs from timestamp, which represents the time at
which the statistics were generated by the local endpoint. MediaSourceID is the identifier of the stats object representing the track currently
attached to the sender of this stream, an RTCMediaSourceStats. Mid represents a mid value of RTPTransceiver owning this stream, if that value is not
null. Otherwise, this member is not present. NACKCount counts the total number of Negative ACKnowledgement (NACK) packets
received by the sender and is sent by receiver. PLICount counts the total number of Picture Loss Indication (PLI) packets
received by the sender. This metric is only valid for video and is sent by receiver. PacketsDiscardedOnSend is the total number of RTP packets for this SSRC that
have been discarded due to socket errors, i.e. a socket error occurred when handing
the packets to the socket. This might happen due to various reasons, including
full buffer or no available memory. PacketsSent is the total number of RTP packets sent for this SSRC. PerDSCPPacketsSent is the total number of packets sent for this SSRC, per DSCP.
DSCPs are identified as decimal integers in string form. PowerEfficientEncoder indicates whether the encoder currently used is considered power efficient.
by the user agent. Does not exist for audio. QPSum is the sum of the QP values of frames passed. The count of frames is
in FramesDecoded for inbound stream stats, and in FramesEncoded for outbound stream stats. QualityLimitationDurations is record of the total time, in seconds, that this
stream has spent in each quality limitation state. The record includes a mapping
for all QualityLimitationReason types, including "none". Only valid for video. QualityLimitationReason is the current reason for limiting the resolution and/or framerate,
or "none" if not limited. Only valid for video. QualityLimitationResolutionChanges is the number of times that the resolution has changed
because we are quality limited (qualityLimitationReason has a value other than "none").
The counter is initially zero and increases when the resolution goes up or down.
For example, if a 720p track is sent as 480p for some time and then recovers to 720p,
qualityLimitationResolutionChanges will have the value 2. Does not exist for audio. RemoteID is used for looking up the remote RemoteInboundRTPStreamStats object
for the same SSRC. RetransmittedBytesSent is the total number of bytes that were retransmitted for this SSRC,
only including payload bytes. This is a subset of bytesSent. If RTX is not negotiated,
retransmitted bytes are sent over this ssrc. If RTX was negotiated, retransmitted bytes
are sent over a separate SSRC but is still accounted for here. RetransmittedPacketsSent is the total number of packets that were retransmitted for this SSRC.
This is a subset of packetsSent. If RTX is not negotiated, retransmitted packets are sent
over this ssrc. If RTX was negotiated, retransmitted packets are sent over a separate SSRC
but is still accounted for here. Rid only exists if a rid has been set for this RTP stream.
Must not exist for audio. SLICount counts the total number of Slice Loss Indication (SLI) packets received
by the sender. This metric is only valid for video and is sent by receiver. SSRC is the 32-bit unsigned integer value used to identify the source of the
stream of RTP packets that this stats object concerns. ScalabilityMode identifies the layering mode used for video encoding. Does not exist for audio. SenderID is the stats ID used to look up the AudioSenderStats or VideoSenderStats
object sending this stream. TargetBitrate is the current target bitrate configured for this particular SSRC
and is the Transport Independent Application Specific (TIAS) bitrate [RFC3890].
Typically, the target bitrate is a configuration parameter provided to the codec's
encoder and does not count the size of the IP or other transport layers like TCP or UDP.
It is measured in bits per second and the bitrate is calculated over a 1 second window. Timestamp is the timestamp associated with this object. TotalEncodeTime is the total number of seconds that has been spent encoding the
framesEncoded frames of this stream. The average encode time can be calculated by
dividing this value with FramesEncoded. The time it takes to encode one frame is the
time passed between feeding the encoder a frame and the encoder returning encoded data
for that frame. This does not include any additional time it may take to packetize the resulting data. TotalEncodedBytesTarget is increased by the target frame size in bytes every time
a frame has been encoded. The actual frame size may be bigger or smaller than this number.
This value goes up every time framesEncoded goes up. TotalPacketSendDelay is the total number of seconds that packets have spent buffered
locally before being transmitted onto the network. The time is measured from when
a packet is emitted from the RTP packetizer until it is handed over to the OS network socket.
This measurement is added to totalPacketSendDelay when packetsSent is incremented. TrackID is the identifier of the stats object representing the current track
attachment to the sender of this stream, a SenderAudioTrackAttachmentStats
or SenderVideoTrackAttachmentStats. It is a unique identifier that is associated to the object that was inspected
to produce the TransportStats associated with this RTP stream. Type is the object's StatsType
OutboundRTPStreamStats : Stats
PeerConnection represents a WebRTC connection that establishes a
peer-to-peer communications with another PeerConnection instance in a
browser, or to another endpoint implementing the required protocols. AddICECandidate accepts an ICE candidate string and adds it
to the existing set of candidates. AddTrack adds a Track to the PeerConnection. AddTransceiverFromKind Create a new RtpTransceiver and adds it to the set of transceivers. AddTransceiverFromTrack Create a new RtpTransceiver(SendRecv or SendOnly) and add it to the set of transceivers. Close ends the PeerConnection. ConnectionState attribute returns the connection state of the
PeerConnection instance. CreateAnswer starts the PeerConnection and generates the localDescription. CreateDataChannel creates a new DataChannel object with the given label
and optional DataChannelInit used to configure properties of the
underlying channel such as data reliability. CreateOffer starts the PeerConnection and generates the localDescription
https://w3c.github.io/webrtc-pc/#dom-rtcpeerconnection-createoffer CurrentLocalDescription represents the local description that was
successfully negotiated the last time the PeerConnection transitioned
into the stable state plus any local candidates that have been generated
by the ICEAgent since the offer or answer was created. CurrentRemoteDescription represents the last remote description that was
successfully negotiated the last time the PeerConnection transitioned
into the stable state plus any remote candidates that have been supplied
via AddICECandidate() since the offer or answer was created. GetConfiguration returns a Configuration object representing the current
configuration of this PeerConnection object. The returned object is a
copy and direct mutation on it will not take affect until SetConfiguration
has been called with Configuration passed as its only argument.
https://www.w3.org/TR/webrtc/#dom-rtcpeerconnection-getconfiguration GetReceivers returns the RTPReceivers that are currently attached to this PeerConnection. GetSenders returns the RTPSender that are currently attached to this PeerConnection. GetStats return data providing statistics about the overall connection. GetTransceivers returns the RtpTransceiver that are currently attached to this PeerConnection. GracefulClose ends the PeerConnection. It also waits
for any goroutines it started to complete. This is only safe to call outside of
PeerConnection callbacks or if in a callback, in its own goroutine. ICEConnectionState returns the ICE connection state of the
PeerConnection instance. ICEGatheringState attribute returns the ICE gathering state of the
PeerConnection instance. LocalDescription returns PendingLocalDescription if it is not null and
otherwise it returns CurrentLocalDescription. This property is used to
determine if SetLocalDescription has already been called.
https://www.w3.org/TR/webrtc/#dom-rtcpeerconnection-localdescription OnConnectionStateChange sets an event handler which is called
when the PeerConnectionState has changed. OnDataChannel sets an event handler which is invoked when a data
channel message arrives from a remote peer. OnICECandidate sets an event handler which is invoked when a new ICE
candidate is found.
ICE candidate gathering only begins when SetLocalDescription or
SetRemoteDescription is called.
Take note that the handler will be called with a nil pointer when
gathering is finished. OnICEConnectionStateChange sets an event handler which is called
when an ICE connection state is changed. OnICEGatheringStateChange sets an event handler which is invoked when the
ICE candidate gathering state has changed. OnNegotiationNeeded sets an event handler which is invoked when
a change has occurred which requires session negotiation. OnSignalingStateChange sets an event handler which is invoked when the
peer connection's signaling state changes. OnTrack sets an event handler which is called when remote track
arrives from a remote peer. PendingLocalDescription represents a local description that is in the
process of being negotiated plus any local candidates that have been
generated by the ICEAgent since the offer or answer was created. If the
PeerConnection is in the stable state, the value is null. PendingRemoteDescription represents a remote description that is in the
process of being negotiated, complete with any remote candidates that
have been supplied via AddICECandidate() since the offer or answer was
created. If the PeerConnection is in the stable state, the value is
null. RemoteDescription returns pendingRemoteDescription if it is not null and
otherwise it returns currentRemoteDescription. This property is used to
determine if setRemoteDescription has already been called.
https://www.w3.org/TR/webrtc/#dom-rtcpeerconnection-remotedescription RemoveTrack removes a Track from the PeerConnection. SCTP returns the SCTPTransport for this PeerConnection
The SCTP transport over which SCTP data is sent and received. If SCTP has not been negotiated, the value is nil.
https://www.w3.org/TR/webrtc/#attributes-15 SetConfiguration updates the configuration of this PeerConnection object. SetIdentityProvider is used to configure an identity provider to generate identity assertions. SetLocalDescription sets the SessionDescription of the local peer SetRemoteDescription sets the SessionDescription of the remote peer SignalingState attribute returns the signaling state of the
PeerConnection instance. WriteRTCP sends a user provided RTCP packet to the connected peer. If no peer is connected the
packet is discarded. It also runs any configured interceptors.
*PeerConnection : github.com/prometheus/common/expfmt.Closer
*PeerConnection : io.Closer
func NewPeerConnection(configuration Configuration) (*PeerConnection, error)
func (*API).NewPeerConnection(configuration Configuration) (*PeerConnection, error)
func GatheringCompletePromise(pc *PeerConnection) (gatherComplete <-chan struct{})
func StatsReport.GetConnectionStats(conn *PeerConnection) (PeerConnectionStats, bool)
PeerConnectionStats contains statistics related to the PeerConnection object. DataChannelsAccepted represents the number of unique DataChannels signaled
in a "datachannel" event on the PeerConnection. DataChannelsClosed represents the number of unique DataChannels that have
left the "open" state during their lifetime (due to being closed by either
end or the underlying transport being closed). DataChannels that transition
from "connecting" to "closing" or "closed" without ever being "open"
are not counted in this number. DataChannelsOpened represents the number of unique DataChannels that have
entered the "open" state during their lifetime. DataChannelsRequested Represents the number of unique DataChannels returned
from a successful createDataChannel() call on the PeerConnection. If the
underlying data transport is not established, these may be in the "connecting" state. ID is a unique id that is associated with the component inspected to produce
this Stats object. Two Stats objects will have the same ID if they were produced
by inspecting the same underlying object. Timestamp is the timestamp associated with this object. Type is the object's StatsType
PeerConnectionStats : Stats
func StatsReport.GetConnectionStats(conn *PeerConnection) (PeerConnectionStats, bool)
RemoteInboundRTPStreamStats contains statistics for the remote endpoint's inbound
RTP stream corresponding to an outbound stream that is currently sent with this
PeerConnection object. It is measured at the remote endpoint and reported in an RTCP
Receiver Report (RR) or RTCP Extended Report (XR). BurstDiscardCount is the cumulative number of bursts of discarded RTP packets. BurstDiscardRate is the fraction of RTP packets discarded during bursts to
the total number of RTP packets expected in bursts. BurstLossCount is the cumulative number of bursts of lost RTP packets. BurstLossRate is the fraction of RTP packets lost during bursts to the
total number of RTP packets expected in the bursts. BurstPacketsDiscarded is the cumulative number of RTP packets discarded during discard bursts. BurstPacketsLost is the cumulative number of RTP packets lost during loss bursts. CodecID is a unique identifier that is associated to the object that was inspected
to produce the CodecStats associated with this RTP stream. FIRCount counts the total number of Full Intra Request (FIR) packets received
by the sender. This metric is only valid for video and is sent by receiver. FractionLost is the fraction packet loss reported for this SSRC. GapDiscardRate is the fraction of RTP packets discarded during the gap periods. GapLossRate is the fraction of RTP packets lost during the gap periods. ID is a unique id that is associated with the component inspected to produce
this Stats object. Two Stats objects will have the same ID if they were produced
by inspecting the same underlying object. Jitter is the packet jitter measured in seconds for this SSRC Kind is either "audio" or "video" LocalID is used for looking up the local OutboundRTPStreamStats object for the same SSRC. NACKCount counts the total number of Negative ACKnowledgement (NACK) packets
received by the sender and is sent by receiver. PLICount counts the total number of Picture Loss Indication (PLI) packets
received by the sender. This metric is only valid for video and is sent by receiver. PacketsDiscarded is the cumulative number of RTP packets discarded by the jitter
buffer due to late or early-arrival, i.e., these packets are not played out.
RTP packets discarded due to packet duplication are not reported in this metric. PacketsLost is the total number of RTP packets lost for this SSRC. Note that
because of how this is estimated, it can be negative if more packets are received than sent. PacketsReceived is the total number of RTP packets received for this SSRC. PacketsRepaired is the cumulative number of lost RTP packets repaired after applying
an error-resilience mechanism. It is measured for the primary source RTP packets
and only counted for RTP packets that have no further chance of repair. QPSum is the sum of the QP values of frames passed. The count of frames is
in FramesDecoded for inbound stream stats, and in FramesEncoded for outbound stream stats. RoundTripTime is the estimated round trip time for this SSRC based on the
RTCP timestamps in the RTCP Receiver Report (RR) and measured in seconds. RoundTripTimeMeasurements represents the total number of RTCP RR blocks received for this SSRC
that contain a valid round trip time. This counter will not increment if the RoundTripTime can
not be calculated because no RTCP Receiver Report with a DLSR value other than 0 has been received. SLICount counts the total number of Slice Loss Indication (SLI) packets received
by the sender. This metric is only valid for video and is sent by receiver. SSRC is the 32-bit unsigned integer value used to identify the source of the
stream of RTP packets that this stats object concerns. Timestamp is the timestamp associated with this object. TotalRoundTripTime represents the cumulative sum of all round trip time measurements
in seconds since the beginning of the session. The individual round trip time is calculated
based on the RTCP timestamps in the RTCP Receiver Report (RR) [RFC3550], hence requires
a DLSR value other than 0. The average round trip time can be computed from
TotalRoundTripTime by dividing it by RoundTripTimeMeasurements. It is a unique identifier that is associated to the object that was inspected
to produce the TransportStats associated with this RTP stream. Type is the object's StatsType
RemoteInboundRTPStreamStats : Stats
RemoteOutboundRTPStreamStats contains statistics for the remote endpoint's outbound
RTP stream corresponding to an inbound stream that is currently received with this
PeerConnection object. It is measured at the remote endpoint and reported in an
RTCP Sender Report (SR). BytesDiscardedOnSend is the total number of bytes for this SSRC that have
been discarded due to socket errors, i.e. a socket error occurred when handing
the packets containing the bytes to the socket. This might happen due to various
reasons, including full buffer or no available memory. BytesSent is the total number of bytes sent for this SSRC. CodecID is a unique identifier that is associated to the object that was inspected
to produce the CodecStats associated with this RTP stream. FECPacketsSent is the total number of RTP FEC packets sent for this SSRC.
This counter can also be incremented when sending FEC packets in-band with
media packets (e.g., with Opus). FIRCount counts the total number of Full Intra Request (FIR) packets received
by the sender. This metric is only valid for video and is sent by receiver. ID is a unique id that is associated with the component inspected to produce
this Stats object. Two Stats objects will have the same ID if they were produced
by inspecting the same underlying object. Kind is either "audio" or "video" LocalID is used for looking up the local InboundRTPStreamStats object for the same SSRC. NACKCount counts the total number of Negative ACKnowledgement (NACK) packets
received by the sender and is sent by receiver. PLICount counts the total number of Picture Loss Indication (PLI) packets
received by the sender. This metric is only valid for video and is sent by receiver. PacketsDiscardedOnSend is the total number of RTP packets for this SSRC that
have been discarded due to socket errors, i.e. a socket error occurred when handing
the packets to the socket. This might happen due to various reasons, including
full buffer or no available memory. PacketsSent is the total number of RTP packets sent for this SSRC. QPSum is the sum of the QP values of frames passed. The count of frames is
in FramesDecoded for inbound stream stats, and in FramesEncoded for outbound stream stats. RemoteTimestamp represents the remote timestamp at which these statistics were
sent by the remote endpoint. This differs from timestamp, which represents the
time at which the statistics were generated or received by the local endpoint.
The RemoteTimestamp, if present, is derived from the NTP timestamp in an RTCP
Sender Report (SR) packet, which reflects the remote endpoint's clock.
That clock may not be synchronized with the local clock. ReportsSent represents the total number of RTCP Sender Report (SR) blocks sent for this SSRC. RoundTripTime is estimated round trip time for this SSRC based on the latest
RTCP Sender Report (SR) that contains a DLRR report block as defined in [RFC3611].
The Calculation of the round trip time is defined in section 4.5. of [RFC3611].
Does not exist if the latest SR does not contain the DLRR report block, or if the last RR timestamp
in the DLRR report block is zero, or if the delay since last RR value in the DLRR report block is zero. RoundTripTimeMeasurements represents the total number of RTCP Sender Report (SR) blocks
received for this SSRC that contain a DLRR report block that can derive a valid round trip time
according to [RFC3611]. This counter will not increment if the RoundTripTime can not be calculated. SLICount counts the total number of Slice Loss Indication (SLI) packets received
by the sender. This metric is only valid for video and is sent by receiver. SSRC is the 32-bit unsigned integer value used to identify the source of the
stream of RTP packets that this stats object concerns. Timestamp is the timestamp associated with this object. TotalRoundTripTime represents the cumulative sum of all round trip time measurements in seconds
since the beginning of the session. The individual round trip time is calculated based on the DLRR
report block in the RTCP Sender Report (SR) [RFC3611]. This counter will not increment if the
RoundTripTime can not be calculated. The average round trip time can be computed from
TotalRoundTripTime by dividing it by RoundTripTimeMeasurements. It is a unique identifier that is associated to the object that was inspected
to produce the TransportStats associated with this RTP stream. Type is the object's StatsType
RemoteOutboundRTPStreamStats : Stats
RTPContributingSourceStats contains statistics for a contributing source (CSRC) that contributed
to an inbound RTP stream. AudioLevel is present if the last received RTP packet that this source contributed
to contained an [RFC6465] mixer-to-client audio level header extension. The value
of audioLevel is between 0..1 (linear), where 1.0 represents 0 dBov, 0 represents
silence, and 0.5 represents approximately 6 dBSPL change in the sound pressure level from 0 dBov. ContributorSSRC is the SSRC identifier of the contributing source represented
by this stats object. It is a 32-bit unsigned integer that appears in the CSRC
list of any packets the relevant source contributed to. ID is a unique id that is associated with the component inspected to produce
this Stats object. Two Stats objects will have the same ID if they were produced
by inspecting the same underlying object. InboundRTPStreamID is the ID of the InboundRTPStreamStats object representing
the inbound RTP stream that this contributing source is contributing to. PacketsContributedTo is the total number of RTP packets that this contributing
source contributed to. This value is incremented each time a packet is counted
by InboundRTPStreamStats.packetsReceived, and the packet's CSRC list contains
the SSRC identifier of this contributing source, ContributorSSRC. Timestamp is the timestamp associated with this object. Type is the object's StatsType
RTPContributingSourceStats : Stats
RTPReceiver allows an application to inspect the receipt of a TrackRemote. GetParameters describes the current configuration for the encoding and
transmission of media on the receiver's track. RTPTransceiver returns the RTPTransceiver this
RTPReceiver belongs too, or nil if none. Read reads incoming RTCP for this RTPReceiver. ReadRTCP is a convenience method that wraps Read and unmarshal for you.
It also runs any configured interceptors. ReadSimulcast reads incoming RTCP for this RTPReceiver for given rid. ReadSimulcastRTCP is a convenience method that wraps ReadSimulcast and unmarshal for you. Receive initialize the track and starts all the transports. SetRTPParameters applies provided RTPParameters the RTPReceiver's tracks.
This method is part of the ORTC API. It is not
meant to be used together with the basic WebRTC API.
The amount of provided codecs must match the number of tracks on the receiver. SetReadDeadline sets the max amount of time the RTCP stream will block before returning. 0 is forever. SetReadDeadlineSimulcast sets the max amount of time the RTCP stream for a given rid will block before returning.
0 is forever. Stop irreversibly stops the RTPReceiver. Track returns the RtpTransceiver TrackRemote. Tracks returns the RtpTransceiver tracks
A RTPReceiver to support Simulcast may now have multiple tracks. Transport returns the currently-configured *DTLSTransport or nil
if one has not yet been configured.
*RTPReceiver : github.com/pion/datachannel.ReadDeadliner
func (*API).NewRTPReceiver(kind RTPCodecType, transport *DTLSTransport) (*RTPReceiver, error)
func (*PeerConnection).GetReceivers() (receivers []*RTPReceiver)
func (*RTPTransceiver).Receiver() *RTPReceiver
RTPSender allows an application to control how a given Track is encoded and transmitted to a remote peer. AddEncoding adds an encoding to RTPSender. Used by simulcast senders. GetParameters describes the current configuration for the encoding and
transmission of media on the sender's track. Read reads incoming RTCP for this RTPSender. ReadRTCP is a convenience method that wraps Read and unmarshals for you. ReadSimulcast reads incoming RTCP for this RTPSender for given rid. ReadSimulcastRTCP is a convenience method that wraps ReadSimulcast and unmarshal for you. ReplaceTrack replaces the track currently being used as the sender's source with a new TrackLocal.
The new track must be of the same media kind (audio, video, etc) and switching the track should not
require negotiation. Send Attempts to set the parameters controlling the sending of media. SetReadDeadline sets the deadline for the Read operation.
Setting to zero means no deadline. SetReadDeadlineSimulcast sets the max amount of time the RTCP stream for a given rid
will block before returning. 0 is forever. Stop irreversibly stops the RTPSender. Track returns the RTCRtpTransceiver track, or nil. Transport returns the currently-configured *DTLSTransport or nil
if one has not yet been configured.
*RTPSender : github.com/pion/datachannel.ReadDeadliner
func (*API).NewRTPSender(track TrackLocal, transport *DTLSTransport) (*RTPSender, error)
func (*PeerConnection).AddTrack(track TrackLocal) (*RTPSender, error)
func (*PeerConnection).GetSenders() (result []*RTPSender)
func (*RTPTransceiver).Sender() *RTPSender
func (*PeerConnection).RemoveTrack(sender *RTPSender) (err error)
func (*RTPTransceiver).SetSender(s *RTPSender, track TrackLocal) error
RTPTransceiver represents a combination of an RTPSender and an RTPReceiver that share a common mid. Direction returns the RTPTransceiver's current direction. Kind returns RTPTransceiver's kind. Mid gets the Transceiver's mid value. When not already set, this value will be set in CreateOffer or CreateAnswer. Receiver returns the RTPTransceiver's RTPReceiver if it has one. Sender returns the RTPTransceiver's RTPSender if it has one. SetCodecPreferences sets preferred list of supported codecs
if codecs is empty or nil we reset to default from MediaEngine. SetMid sets the RTPTransceiver's mid. If it was already set, will return an error. SetSender sets the RTPSender and Track to current transceiver. Stop irreversibly stops the RTPTransceiver.
func (*PeerConnection).AddTransceiverFromKind(kind RTPCodecType, init ...RTPTransceiverInit) (t *RTPTransceiver, err error)
func (*PeerConnection).AddTransceiverFromTrack(track TrackLocal, init ...RTPTransceiverInit) (t *RTPTransceiver, err error)
func (*PeerConnection).GetTransceivers() []*RTPTransceiver
func (*RTPReceiver).RTPTransceiver() *RTPTransceiver
SCTPTransport provides details about the SCTP transport. BufferedAmount returns total amount (in bytes) of currently buffered user data. GetCapabilities returns the SCTPCapabilities of the SCTPTransport. MaxChannels is the maximum number of RTCDataChannels that can be open simultaneously. OnClose sets an event handler which is invoked when the SCTP Association closes. OnDataChannel sets an event handler which is invoked when a data
channel message arrives from a remote peer. OnDataChannelOpened sets an event handler which is invoked when a data
channel is opened. OnError sets an event handler which is invoked when the SCTP Association errors. Start the SCTPTransport. Since both local and remote parties must mutually
create an SCTPTransport, SCTP SO (Simultaneous Open) is used to establish
a connection over SCTP. State returns the current state of the SCTPTransport. Stop stops the SCTPTransport. Transport returns the DTLSTransport instance the SCTPTransport is sending over.
func (*API).NewSCTPTransport(dtls *DTLSTransport) *SCTPTransport
func (*DataChannel).Transport() *SCTPTransport
func (*PeerConnection).SCTP() *SCTPTransport
func (*API).NewDataChannel(transport *SCTPTransport, params *DataChannelParameters) (*DataChannel, error)
SCTPTransportStats contains information about a certificate used by an SCTPTransport. BytesReceived represents the total number of bytes received on this SCTPTransport BytesSent represents the total number of bytes sent on this SCTPTransport CongestionWindow is the latest congestion window, corresponding to spinfo_cwnd defined in [RFC6458]. ID is a unique id that is associated with the component inspected to produce
this Stats object. Two Stats objects will have the same ID if they were produced
by inspecting the same underlying object. MTU is the latest maximum transmission unit, corresponding to spinfo_mtu defined in [RFC6458]. ReceiverWindow is the latest receiver window, corresponding to sstat_rwnd defined in [RFC6458]. SmoothedRoundTripTime is the latest smoothed round-trip time value,
corresponding to spinfo_srtt defined in [RFC6458] but converted to seconds.
If there has been no round-trip time measurements yet, this value is undefined. Timestamp is the timestamp associated with this object. TransportID is the identifier of the object that was inspected to produce the
RTCTransportStats for the DTLSTransport and ICETransport supporting the SCTP transport. Type is the object's StatsType UNACKData is the number of unacknowledged DATA chunks, corresponding to sstat_unackdata defined in [RFC6458].
SCTPTransportStats : Stats
SenderAudioTrackAttachmentStats object represents the stats about one attachment
of an audio MediaStreamTrack to the PeerConnection object for which one calls GetStats.
It appears in the stats as soon as it is attached (via AddTrack, via AddTransceiver,
via ReplaceTrack on an RTPSender object).
If an audio track is attached twice (via AddTransceiver or ReplaceTrack), there
will be two SenderAudioTrackAttachmentStats objects, one for each attachment.
They will have the same "TrackIdentifier" attribute, but different "ID" attributes.
If the track is detached from the PeerConnection (via removeTrack or via replaceTrack),
it continues to appear, but with the "ObjectDeleted" member set to true. AudioLevel represents the output audio level of the track.
The value is a value between 0..1 (linear), where 1.0 represents 0 dBov,
0 represents silence, and 0.5 represents approximately 6 dBSPL change in
the sound pressure level from 0 dBov.
If the track is sourced from an Receiver, does no audio processing, has a
constant level, and has a volume setting of 1.0, the audio level is expected
to be the same as the audio level of the source SSRC, while if the volume setting
is 0.5, the AudioLevel is expected to be half that value.
For outgoing audio tracks, the AudioLevel is the level of the audio being sent. EchoReturnLoss is only present while the sender is sending a track sourced from
a microphone where echo cancellation is applied. Calculated in decibels. EchoReturnLossEnhancement is only present while the sender is sending a track
sourced from a microphone where echo cancellation is applied. Calculated in decibels. Ended reflects the "ended" state of the track. ID is a unique id that is associated with the component inspected to produce
this Stats object. Two Stats objects will have the same ID if they were produced
by inspecting the same underlying object. Kind is "audio" RemoteSource is true if the source is remote, for instance if it is sourced
from another host via a PeerConnection. False otherwise. Only applicable for 'track' stats. Timestamp is the timestamp associated with this object. TotalAudioEnergy is the total energy of all the audio samples sent/received
for this object, calculated by duration * Math.pow(energy/maxEnergy, 2) for
each audio sample seen. TotalSamplesDuration represents the total duration in seconds of all samples
that have sent or received (and thus counted by TotalSamplesSent or TotalSamplesReceived).
Can be used with TotalAudioEnergy to compute an average audio level over different intervals. TotalSamplesSent is the total number of samples that have been sent by this sender. TrackIdentifier represents the id property of the track. Type is the object's StatsType VoiceActivityFlag represents whether the last RTP packet sent or played out
by this track contained voice activity or not based on the presence of the
V bit in the extension header, as defined in [RFC6464].
This value indicates the voice activity in the latest RTP packet played out
from a given SSRC, and is defined in RTPSynchronizationSource.voiceActivityFlag.
SenderAudioTrackAttachmentStats : Stats
SenderVideoTrackAttachmentStats represents the stats about one attachment of a
video MediaStreamTrack to the PeerConnection object for which one calls GetStats.
It appears in the stats as soon as it is attached (via AddTrack, via AddTransceiver,
via ReplaceTrack on an RTPSender object).
If a video track is attached twice (via AddTransceiver or ReplaceTrack), there
will be two SenderVideoTrackAttachmentStats objects, one for each attachment.
They will have the same "TrackIdentifier" attribute, but different "ID" attributes.
If the track is detached from the PeerConnection (via RemoveTrack or via ReplaceTrack),
it continues to appear, but with the "ObjectDeleted" member set to true. FramesCaptured represents the total number of frames captured, before encoding,
for this RTPSender (or for this MediaStreamTrack, if type is "track"). For example,
if type is "sender" and this sender's track represents a camera, then this is the
number of frames produced by the camera for this track while being sent by this sender,
combined with the number of frames produced by all tracks previously attached to this
sender while being sent by this sender. Framerates can vary due to hardware limitations
or environmental factors such as lighting conditions. FramesSent represents the total number of frames sent by this RTPSender
(or for this MediaStreamTrack, if type is "track"). HugeFramesSent represents the total number of huge frames sent by this RTPSender
(or for this MediaStreamTrack, if type is "track"). Huge frames, by definition,
are frames that have an encoded size at least 2.5 times the average size of the frames.
The average size of the frames is defined as the target bitrate per second divided
by the target fps at the time the frame was encoded. These are usually complex
to encode frames with a lot of changes in the picture. This can be used to estimate,
e.g slide changes in the streamed presentation. If a huge frame is also a key frame,
then both counters HugeFramesSent and KeyFramesSent are incremented. ID is a unique id that is associated with the component inspected to produce
this Stats object. Two Stats objects will have the same ID if they were produced
by inspecting the same underlying object. KeyFramesSent represents the total number of key frames sent by this RTPSender
(or for this MediaStreamTrack, if type is "track"), such as Infra-frames in
VP8 [RFC6386] or I-frames in H.264 [RFC6184]. This is a subset of FramesSent.
FramesSent - KeyFramesSent gives you the number of delta frames sent. Kind is "video" Timestamp is the timestamp associated with this object. Type is the object's StatsType
SenderVideoTrackAttachmentStats : Stats
SettingEngine allows influencing behavior in ways that are not
supported by the WebRTC API. This allows us to support additional
use-cases without deviating from the WebRTC API elsewhere.BufferFactoryfunc(packetType packetio.BufferPacketType, ssrc uint32) io.ReadWriteCloserLoggerFactorylogging.LoggerFactory DetachDataChannels enables detaching data channels. When enabled
data channels have to be detached in the OnOpen callback using the
DataChannel.Detach method. DisableActiveTCP disables using active TCP for ICE. Active TCP is enabled by default. DisableCertificateFingerprintVerification disables fingerprint verification after DTLS Handshake has finished. DisableCloseByDTLS sets if the connection should be closed when dtls transport is closed.
Setting this to true will keep the connection open when dtls transport is closed
and relies on the ice failed state to detect the connection is interrupted. DisableMediaEngineCopy stops the MediaEngine from being copied. This allows a user to modify
the MediaEngine after the PeerConnection has been constructed. This is useful if you wish to
modify codecs after signaling. Make sure not to share MediaEngines between PeerConnections. DisableMediaEngineMultipleCodecs disables the MediaEngine negotiating different codecs.
With the default value multiple media sections in the SDP can each negotiate different
codecs. This is the new default behvior, because it makes Pion more spec compliant.
The value of this setting will get copied to every copy of the MediaEngine generated
for new PeerConnections (assuming DisableMediaEngineCopy is set to false).
Note: this setting is targeted to be removed in release 4.2.0 (or later). DisableSRTCPReplayProtection disables SRTCP replay protection. DisableSRTPReplayProtection disables SRTP replay protection. EnableDataChannelBlockWrite allows data channels to block on write,
it only works if DetachDataChannels is enabled. EnableSCTPZeroChecksum controls the zero checksum feature in SCTP.
This removes the need to checksum every incoming/outgoing packet and will reduce
latency and CPU usage. This feature is not backwards compatible so is disabled by default. SetAnsweringDTLSRole sets the DTLS role that is selected when offering
The DTLS role controls if the WebRTC Client as a client or server. This
may be useful when interacting with non-compliant clients or debugging issues.
DTLSRoleActive:
Act as DTLS Client, send the ClientHello and starts the handshake
DTLSRolePassive:
Act as DTLS Server, wait for ClientHello SetDTLSCertificateRequestMessageHook if not nil, is called when a DTLS Certificate Request message is sent
from a client. The returned handshake message replaces the original message. SetDTLSClientAuth sets the client auth type for DTLS. SetDTLSClientCAs sets the client CA certificate pool for DTLS certificate verification. SetDTLSClientHelloMessageHook if not nil, is called when a DTLS Client Hello message is sent
from a client. The returned handshake message replaces the original message. SetDTLSConnectContextMaker sets the context used during the DTLS Handshake.
It can be used to extend or reduce the timeout on the DTLS Handshake.
If nil, the default dtls.ConnectContextMaker is used. It can be implemented as following.
func ConnectContextMaker() (context.Context, func()) {
return context.WithTimeout(context.Background(), 30*time.Second)
} SetDTLSCustomerCipherSuites allows the user to specify a list of DTLS CipherSuites.
This allow usage of Ciphers that are reserved for private usage. SetDTLSDisableInsecureSkipVerify sets the disable skip insecure verify flag for DTLS.
This controls whether a client verifies the server's certificate chain and host name. SetDTLSEllipticCurves sets the elliptic curves for DTLS. SetDTLSExtendedMasterSecret sets the extended master secret type for DTLS. SetDTLSInsecureSkipHelloVerify sets the skip HelloVerify flag for DTLS.
If true and when acting as DTLS server, will allow client to skip hello verify phase and
receive ServerHello after initial ClientHello. This will mean faster connect times,
but will have lower DoS attack resistance. SetDTLSKeyLogWriter sets the destination of the TLS key material for debugging.
Logging key material compromises security and should only be use for debugging. SetDTLSReplayProtectionWindow sets a replay attack protection window size of DTLS connection. SetDTLSRetransmissionInterval sets the retranmission interval for DTLS. SetDTLSRootCAs sets the root CA certificate pool for DTLS certificate verification. SetDTLSServerHelloMessageHook if not nil, is called when a DTLS Server Hello message is sent
from a client. The returned handshake message replaces the original message. SetEphemeralUDPPortRange limits the pool of ephemeral ports that
ICE UDP connections can allocate from. This affects both host candidates,
and the local address of server reflexive candidates.
When portMin and portMax are left to the 0 default value, pion/ice candidate
gatherer replaces them and uses 1 for portMin and 65535 for portMax. SetFireOnTrackBeforeFirstRTP sets if firing the OnTrack event should happen
before any RTP packets are received. Setting this to true will
have the Track's Codec and PayloadTypes be initially set to their
zero values in the OnTrack handler.
Note: This does not yet affect simulcast tracks. SetHostAcceptanceMinWait sets the ICEHostAcceptanceMinWait. SetICEBindingRequestHandler sets a callback that is fired on a STUN BindingRequest
This allows users to do things like
- Log incoming Binding Requests for debugging
- Implement draft-thatcher-ice-renomination
- Implement custom CandidatePair switching logic. SetICECredentials sets a staic uFrag/uPwd to be used by pion/ice
This is useful if you want to do signalless WebRTC session,
or having a reproducible environment with static credentials. SetICEMaxBindingRequests sets the maximum amount of binding requests
that can be sent on a candidate before it is considered invalid. SetICEMulticastDNSMode controls if pion/ice queries and generates mDNS ICE Candidates. SetICEProxyDialer sets the proxy dialer interface based on golang.org/x/net/proxy. SetICETCPMux enables ICE-TCP when set to a non-nil value. Make sure that
NetworkTypeTCP4 or NetworkTypeTCP6 is enabled as well. SetICETimeouts sets the behavior around ICE Timeouts
disconnectedTimeout:
Duration without network activity before an Agent is considered disconnected. Default is 5 Seconds
failedTimeout:
Duration without network activity before an Agent is considered failed after disconnected. Default is 25 Seconds
keepAliveInterval:
How often the ICE Agent sends extra traffic if there is no activity, if media is flowing no traffic will be sent.
Default is 2 seconds. SetICEUDPMux allows ICE traffic to come through a single UDP port, drastically
simplifying deployments where ports will need to be opened/forwarded.
UDPMux should be started prior to creating PeerConnections. SetIPFilter sets the filtering functions when gathering ICE candidates
This can be used to exclude certain ip from ICE. Which may be
useful if you know a certain ip will never succeed, or if you wish to reduce
the amount of information you wish to expose to the remote peer. SetIncludeLoopbackCandidate enable pion to gather loopback candidates, it is useful
for some VM have public IP mapped to loopback interface. SetInterfaceFilter sets the filtering functions when gathering ICE candidates
This can be used to exclude certain network interfaces from ICE. Which may be
useful if you know a certain interface will never succeed, or if you wish to reduce
the amount of information you wish to expose to the remote peer. SetLite configures whether or not the ice agent should be a lite agent. SetMulticastDNSHostName sets a static HostName to be used by pion/ice instead of generating one on startup
This should only be used for a single PeerConnection.
Having multiple PeerConnections with the same HostName will cause undefined behavior. SetNAT1To1IPs sets a list of external IP addresses of 1:1 (D)NAT
and a candidate type for which the external IP address is used.
This is useful when you host a server using Pion on an AWS EC2 instance
which has a private address, behind a 1:1 DNAT with a public IP (e.g.
Elastic IP). In this case, you can give the public IP address so that
Pion will use the public IP address in its candidate instead of the private
IP address. The second argument, candidateType, is used to tell Pion which
type of candidate should use the given public IP address.
Two types of candidates are supported:
ICECandidateTypeHost:
The public IP address will be used for the host candidate in the SDP.
ICECandidateTypeSrflx:
A server reflexive candidate with the given public IP address will be added to the SDP.
Please note that if you choose ICECandidateTypeHost, then the private IP address
won't be advertised with the peer. Also, this option cannot be used along with mDNS.
If you choose ICECandidateTypeSrflx, it simply adds a server reflexive candidate
with the public IP. The host candidate is still available along with mDNS
capabilities unaffected. Also, you cannot give STUN server URL at the same time.
It will result in an error otherwise. SetNet sets the Net instance that is passed to pion/ice
Net is an network interface layer for Pion, allowing users to replace
Pions network stack with a custom implementation. SetNetworkTypes configures what types of candidate networks are supported
during local and server reflexive gathering. SetPrflxAcceptanceMinWait sets the ICEPrflxAcceptanceMinWait. SetReceiveMTU sets the size of read buffer that copies incoming packets. This is optional.
Leave this 0 for the default receiveMTU. SetRelayAcceptanceMinWait sets the ICERelayAcceptanceMinWait. SetSCTPCwndCAStep sets congestion window adjustment step size during congestion avoidance. SetSCTPFastRtxWnd sets the fast retransmission window size. SetSCTPMaxMessageSize sets the largest message we are willing to accept.
Leave this 0 for the default max message size. SetSCTPMaxReceiveBufferSize sets the maximum receive buffer size.
Leave this 0 for the default maxReceiveBufferSize. SetSCTPMinCwnd sets the minimum congestion window size. The congestion window
will not be smaller than this value during congestion control. SetSCTPRTOMax sets the maximum retransmission timeout.
Leave this 0 for the default timeout. SetSDPMediaLevelFingerprints configures the logic for DTLS Fingerprint insertion
If true, fingerprints will be inserted in the sdp at the fingerprint
level, instead of the session level. This helps with compatibility with
some webrtc implementations. SetSRTCPReplayProtectionWindow sets a replay attack protection window size of SRTCP session. SetSRTPProtectionProfiles allows the user to override the default SRTP Protection Profiles
The default srtp protection profiles are provided by the function `defaultSrtpProtectionProfiles`. SetSRTPReplayProtectionWindow sets a replay attack protection window size of SRTP session. SetSTUNGatherTimeout sets the ICESTUNGatherTimeout. SetSrflxAcceptanceMinWait sets the ICESrflxAcceptanceMinWait.
func WithSettingEngine(s SettingEngine) func(a *API)
StatsReport collects Stats objects indexed by their ID. GetCertificateStats is a helper method to return the associated stats for a given Certificate. GetCodecStats is a helper method to return the associated stats for a given Codec. GetConnectionStats is a helper method to return the associated stats for a given PeerConnection. GetDataChannelStats is a helper method to return the associated stats for a given DataChannel. GetICECandidatePairStats is a helper method to return the associated stats for a given ICECandidatePair. GetICECandidateStats is a helper method to return the associated stats for a given ICECandidate.
func (*PeerConnection).GetStats() StatsReport
StatsTimestamp is a timestamp represented by the floating point number of
milliseconds since the epoch. Time returns the time.Time represented by this timestamp.
StatsTimestamp : golang.org/x/net/internal/timeseries.Clock
TrackLocal is an interface that controls how the user can send media
The user can provide their own TrackLocal implementations, or use
the implementations in pkg/media. Bind should implement the way how the media data flows from the Track to the PeerConnection
This will be called internally after signaling is complete and the list of available
codecs has been determined ID is the unique identifier for this Track. This should be unique for the
stream, but doesn't have to globally unique. A common example would be 'audio' or 'video'
and StreamID would be 'desktop' or 'webcam' Kind controls if this TrackLocal is audio or video RID is the RTP Stream ID for this track. StreamID is the group this track belongs too. This must be unique Unbind should implement the teardown logic when the track is no longer needed. This happens
because a track has been stopped.
*TrackLocalStaticRTP
*TrackLocalStaticSample
func (*RTPSender).Track() TrackLocal
func (*API).NewRTPSender(track TrackLocal, transport *DTLSTransport) (*RTPSender, error)
func (*PeerConnection).AddTrack(track TrackLocal) (*RTPSender, error)
func (*PeerConnection).AddTransceiverFromTrack(track TrackLocal, init ...RTPTransceiverInit) (t *RTPTransceiver, err error)
func (*RTPSender).AddEncoding(track TrackLocal) error
func (*RTPSender).ReplaceTrack(track TrackLocal) error
func (*RTPTransceiver).SetSender(s *RTPSender, track TrackLocal) error
TrackLocalContext is the Context passed when a TrackLocal has been Binded/Unbinded from a PeerConnection, and used
in Interceptors. CodecParameters returns the negotiated RTPCodecParameters. These are the codecs supported by both
PeerConnections and the PayloadTypes HeaderExtensions returns the negotiated RTPHeaderExtensionParameters. These are the header extensions supported by
both PeerConnections and the URI/IDs ID is a unique identifier that is used for both Bind/Unbind RTCPReader returns the RTCP interceptor for this TrackLocal. Used to read RTCP of this TrackLocal. SSRC returns the negotiated SSRC of this track SSRCForwardErrorCorrection returns the negotiated SSRC to send forward error correction for this track SSRCRetransmission returns the negotiated SSRC used to send retransmissions for this track WriteStream returns the WriteStream for this TrackLocal. The implementer writes the outbound
media packets to it
func TrackLocal.Bind(TrackLocalContext) (RTPCodecParameters, error)
func TrackLocal.Unbind(TrackLocalContext) error
func (*TrackLocalStaticRTP).Bind(trackContext TrackLocalContext) (RTPCodecParameters, error)
func (*TrackLocalStaticRTP).Unbind(t TrackLocalContext) error
func (*TrackLocalStaticSample).Bind(t TrackLocalContext) (RTPCodecParameters, error)
func (*TrackLocalStaticSample).Unbind(t TrackLocalContext) error
TrackLocalStaticRTP is a TrackLocal that has a pre-set codec and accepts RTP Packets.
If you wish to send a media.Sample use TrackLocalStaticSample. Bind is called by the PeerConnection after negotiation is complete
This asserts that the code requested is supported by the remote peer.
If so it sets up all the state (SSRC and PayloadType) to have a call. Codec gets the Codec of the track. ID is the unique identifier for this Track. This should be unique for the
stream, but doesn't have to globally unique. A common example would be 'audio' or 'video'
and StreamID would be 'desktop' or 'webcam'. Kind controls if this TrackLocal is audio or video. RID is the RTP stream identifier. StreamID is the group this track belongs too. This must be unique. Unbind implements the teardown logic when the track is no longer needed. This happens
because a track has been stopped. Write writes a RTP Packet as a buffer to the TrackLocalStaticRTP
If one PeerConnection fails the packets will still be sent to
all PeerConnections. The error message will contain the ID of the failed
PeerConnections so you can remove them. WriteRTP writes a RTP Packet to the TrackLocalStaticRTP
If one PeerConnection fails the packets will still be sent to
all PeerConnections. The error message will contain the ID of the failed
PeerConnections so you can remove them.
*TrackLocalStaticRTP : TrackLocal
*TrackLocalStaticRTP : github.com/miekg/dns.Writer
*TrackLocalStaticRTP : internal/bisect.Writer
*TrackLocalStaticRTP : io.Writer
func NewTrackLocalStaticRTP(c RTPCodecCapability, id, streamID string, options ...func(*TrackLocalStaticRTP)) (*TrackLocalStaticRTP, error)
TrackLocalStaticSample is a TrackLocal that has a pre-set codec and accepts Samples.
If you wish to send a RTP Packet use TrackLocalStaticRTP. Bind is called by the PeerConnection after negotiation is complete
This asserts that the code requested is supported by the remote peer.
If so it setups all the state (SSRC and PayloadType) to have a call. Codec gets the Codec of the track. GeneratePadding writes padding-only samples to the TrackLocalStaticSample
If one PeerConnection fails the packets will still be sent to
all PeerConnections. The error message will contain the ID of the failed
PeerConnections so you can remove them. ID is the unique identifier for this Track. This should be unique for the
stream, but doesn't have to globally unique. A common example would be 'audio' or 'video'
and StreamID would be 'desktop' or 'webcam'. Kind controls if this TrackLocal is audio or video. RID is the RTP stream identifier. StreamID is the group this track belongs too. This must be unique. Unbind implements the teardown logic when the track is no longer needed. This happens
because a track has been stopped. WriteSample writes a Sample to the TrackLocalStaticSample
If one PeerConnection fails the packets will still be sent to
all PeerConnections. The error message will contain the ID of the failed
PeerConnections so you can remove them.
*TrackLocalStaticSample : TrackLocal
func NewTrackLocalStaticSample(c RTPCodecCapability, id, streamID string, options ...func(*TrackLocalStaticRTP)) (*TrackLocalStaticSample, error)
TrackLocalWriter is the Writer for outbound RTP Packets. Write encrypts and writes a full RTP packet WriteRTP encrypts a RTP packet and writes to the connection
*github.com/pion/srtp/v3.WriteStreamSRTP
TrackLocalWriter : github.com/miekg/dns.Writer
TrackLocalWriter : internal/bisect.Writer
TrackLocalWriter : io.Writer
func TrackLocalContext.WriteStream() TrackLocalWriter
TrackRemote represents a single inbound source of media. Codec gets the Codec of the track. HasRTX returns true if the track has a separate RTX stream. ID is the unique identifier for this Track. This should be unique for the
stream, but doesn't have to globally unique. A common example would be 'audio' or 'video'
and StreamID would be 'desktop' or 'webcam'. Kind gets the Kind of the track. Msid gets the Msid of the track. PayloadType gets the PayloadType of the track. RID gets the RTP Stream ID of this Track
With Simulcast you will have multiple tracks with the same ID, but different RID values.
In many cases a TrackRemote will not have an RID, so it is important to assert it is non-zero. Read reads data from the track. ReadRTP is a convenience method that wraps Read and unmarshals for you. RtxSSRC returns the RTX SSRC for a track, or 0 if track does not have a separate RTX stream. SSRC gets the SSRC of the track. SetReadDeadline sets the max amount of time the RTP stream will block before returning. 0 is forever. StreamID is the group this track belongs too. This must be unique.
*TrackRemote : github.com/pion/datachannel.ReadDeadliner
func (*RTPReceiver).Track() *TrackRemote
func (*RTPReceiver).Tracks() []*TrackRemote
TransportStats contains transport statistics related to the PeerConnection object. BytesReceived represents the total number of bytes received on this PeerConnection
not including headers or padding. BytesSent represents the total number of payload bytes sent on this PeerConnection
not including headers or padding. DTLSCipher is the descriptive name of the cipher suite used for the DTLS transport,
as defined in the "Description" column of the IANA cipher suite registry. DTLSState is set to the current value of the "state" attribute of the underlying DTLSTransport. ICERole is set to the current value of the "role" attribute of the underlying
DTLSTransport's "iceTransport". ICEState is set to the current value of the "state" attribute of the underlying
RTCIceTransport's "state". ID is a unique id that is associated with the component inspected to produce
this Stats object. Two Stats objects will have the same ID if they were produced
by inspecting the same underlying object. LocalCertificateID is the ID of the CertificateStats for the local certificate.
Present only if DTLS is negotiated. PacketsReceived represents the total number of packets received on this transport. PacketsSent represents the total number of packets sent over this transport. RTCPTransportStatsID is the ID of the transport that gives stats for the RTCP
component If RTP and RTCP are not multiplexed and this record has only
the RTP component stats. LocalCertificateID is the ID of the CertificateStats for the remote certificate.
Present only if DTLS is negotiated. SRTPCipher is the descriptive name of the protection profile used for the SRTP
transport, as defined in the "Profile" column of the IANA DTLS-SRTP protection
profile registry. SelectedCandidatePairID is a unique identifier that is associated to the object
that was inspected to produce the ICECandidatePairStats associated with this transport. Timestamp is the timestamp associated with this object. Type is the object's StatsType
TransportStats : Stats
VideoReceiverStats contains video metrics related to a specific receiver. EstimatedPlayoutTimestamp is the estimated playout time of this receiver's
track. The playout time is the NTP timestamp of the last playable sample that
has a known timestamp (from an RTCP SR packet mapping RTP timestamps to NTP
timestamps), extrapolated with the time elapsed since it was ready to be played out.
This is the "current time" of the track in NTP clock time of the sender and
can be present even if there is no audio currently playing.
This can be useful for estimating how much audio and video is out of
sync for two tracks from the same source:
AudioTrackStats.EstimatedPlayoutTimestamp - VideoTrackStats.EstimatedPlayoutTimestamp FrameHeight represents the height of the last processed frame for this track.
Before the first frame is processed this attribute is missing. FrameWidth represents the width of the last processed frame for this track.
Before the first frame is processed this attribute is missing. FramesDecoded represents the total number of frames correctly decoded for this
SSRC, i.e., frames that would be displayed if no frames are dropped. FramesDropped is the total number of frames dropped predecode or dropped
because the frame missed its display deadline for this receiver's track. FramesPerSecond represents the nominal FPS value before the degradation preference
is applied. It is the number of complete frames in the last second. For sending
tracks it is the current captured FPS and for the receiving tracks it is the
current decoding framerate. FramesReceived Represents the total number of complete frames received for
this receiver. This metric is incremented when the complete frame is received. FullFramesLost is the cumulative number of full frames lost. ID is a unique id that is associated with the component inspected to produce
this Stats object. Two Stats objects will have the same ID if they were produced
by inspecting the same underlying object. JitterBufferDelay is the sum of the time, in seconds, each sample takes from
the time it is received and to the time it exits the jitter buffer.
This increases upon samples exiting, having completed their time in the buffer
(incrementing JitterBufferEmittedCount). The average jitter buffer delay can
be calculated by dividing the JitterBufferDelay with the JitterBufferEmittedCount. JitterBufferEmittedCount is the total number of samples that have come out
of the jitter buffer (increasing JitterBufferDelay). KeyFramesReceived represents the total number of complete key frames received
for this MediaStreamTrack, such as Infra-frames in VP8 [RFC6386] or I-frames
in H.264 [RFC6184]. This is a subset of framesReceived. `framesReceived - keyFramesReceived`
gives you the number of delta frames received. This metric is incremented when
the complete key frame is received. It is not incremented if a partial key
frames is received and sent for decoding, i.e., the frame could not be recovered
via retransmission or FEC. Kind is "video" The cumulative number of partial frames lost. This metric is incremented when
the frame is sent to the decoder. If the partial frame is received and recovered
via retransmission or FEC before decoding, the FramesReceived counter is incremented. Timestamp is the timestamp associated with this object. Type is the object's StatsType
VideoReceiverStats : Stats
VideoSenderStats represents the stats about one video sender of a PeerConnection
object for which one calls GetStats.
It appears in the stats as soon as the sender is added by either AddTrack or
AddTransceiver, or by media negotiation. FramesCaptured represents the total number of frames captured, before encoding,
for this RTPSender (or for this MediaStreamTrack, if type is "track"). For example,
if type is "sender" and this sender's track represents a camera, then this is the
number of frames produced by the camera for this track while being sent by this sender,
combined with the number of frames produced by all tracks previously attached to this
sender while being sent by this sender. Framerates can vary due to hardware limitations
or environmental factors such as lighting conditions. FramesSent represents the total number of frames sent by this RTPSender
(or for this MediaStreamTrack, if type is "track"). HugeFramesSent represents the total number of huge frames sent by this RTPSender
(or for this MediaStreamTrack, if type is "track"). Huge frames, by definition,
are frames that have an encoded size at least 2.5 times the average size of the frames.
The average size of the frames is defined as the target bitrate per second divided
by the target fps at the time the frame was encoded. These are usually complex
to encode frames with a lot of changes in the picture. This can be used to estimate,
e.g slide changes in the streamed presentation. If a huge frame is also a key frame,
then both counters HugeFramesSent and KeyFramesSent are incremented. ID is a unique id that is associated with the component inspected to produce
this Stats object. Two Stats objects will have the same ID if they were produced
by inspecting the same underlying object. KeyFramesSent represents the total number of key frames sent by this RTPSender
(or for this MediaStreamTrack, if type is "track"), such as Infra-frames in
VP8 [RFC6386] or I-frames in H.264 [RFC6184]. This is a subset of FramesSent.
FramesSent - KeyFramesSent gives you the number of delta frames sent. Kind is "video" Timestamp is the timestamp associated with this object. Type is the object's StatsType
VideoSenderStats : Stats
VideoSourceStats represents a video track that is attached to one or more senders. Frames is the total number of frames originating from this source. FramesPerSecond is the number of frames originating from this source, measured during the last second. Height is height of the last frame originating from this source in pixels. ID is a unique id that is associated with the component inspected to produce
this Stats object. Two Stats objects will have the same ID if they were produced
by inspecting the same underlying object. Kind is "video" Timestamp is the timestamp associated with this object. TrackIdentifier represents the id property of the track. Type is the object's StatsType Width is width of the last frame originating from this source in pixels.
VideoSourceStats : Stats
Package-Level Functions (total 37)
CertificateFromPEM creates a fresh certificate based on a string containing
pem blocks fort the private key and x509 certificate.
CertificateFromX509 creates a new WebRTC Certificate from a given PrivateKey and Certificate
This can be used if you want to share a certificate across multiple PeerConnections.
ConfigureFlexFEC03 registers flexfec-03 codec with provided payloadType in mediaEngine
and adds corresponding interceptor to the registry.
Note that this function should be called before any other interceptor that modifies RTP packets
(i.e. TWCCHeaderExtensionSender) is added to the registry, so that packets generated by flexfec
interceptor are not modified.
ConfigureNack will setup everything necessary for handling generating/responding to nack messages.
ConfigureRTCPReports will setup everything necessary for generating Sender and Receiver Reports.
ConfigureSimulcastExtensionHeaders enables the RTP Extension Headers needed for Simulcast.
ConfigureTWCCHeaderExtensionSender will setup everything necessary for adding
a TWCC header extension to outgoing RTP packets. This will allow the remote peer to generate TWCC reports.
ConfigureTWCCSender will setup everything necessary for generating TWCC reports.
This must be called after registering codecs with the MediaEngine.
GatheringCompletePromise is a Pion specific helper function that returns a channel that is closed
when gathering is complete.
This function may be helpful in cases where you are unable to trickle your ICE Candidates.
It is better to not use this function, and instead trickle candidates.
If you use this function you will see longer connection startup times.
When the call is connected you will see no impact however.
GenerateCertificate causes the creation of an X.509 certificate and
corresponding private key.
NewAPI Creates a new API object for keeping semi-global settings to WebRTC objects
It uses the default Codecs and Interceptors unless you customize them
using WithMediaEngine and WithInterceptorRegistry respectively.
NewCertificate generates a new x509 compliant Certificate to be used
by DTLS for encrypting data sent over the wire. This method differs from
GenerateCertificate by allowing to specify a template x509.Certificate to
be used in order to define certificate parameters.
NewICECandidatePair returns an initialized *ICECandidatePair
for the given pair of ICECandidate instances.
NewICECandidateType takes a string and converts it into ICECandidateType.
NewICEConnectionState takes a string and converts it to ICEConnectionState.
NewICEGatheringState takes a string and converts it to ICEGatheringState.
NewICEProtocol takes a string and converts it to ICEProtocol.
NewICETCPMux creates a new instance of ice.TCPMuxDefault. It enables use of
passive ICE TCP candidates.
NewICETransport creates a new NewICETransport.
NewICETransportPolicy takes a string and converts it to ICETransportPolicy.
NewICEUDPMux creates a new instance of ice.UDPMuxDefault. It allows many PeerConnections to be served
by a single UDP Port.
NewNetworkType allows create network type from string
It will be useful for getting custom network types from external config.
NewPeerConnection creates a PeerConnection with the default codecs and interceptors.
If you wish to customize the set of available codecs and/or the set of active interceptors,
create an API with a custom MediaEngine and/or interceptor.Registry,
then call [(*API).NewPeerConnection] instead of this function.
NewRTPCodecType creates a RTPCodecType from a string.
NewRTPTransceiverDirection defines a procedure for creating a new
RTPTransceiverDirection from a raw string naming the transceiver direction.
NewSDPType creates an SDPType from a string.
NewTrackLocalStaticRTP returns a TrackLocalStaticRTP.
NewTrackLocalStaticSample returns a TrackLocalStaticSample.
RegisterDefaultInterceptors will register some useful interceptors.
If you want to customize which interceptors are loaded, you should copy the
code from this method and remove unwanted interceptors.
UnmarshalStatsJSON unmarshals a Stats object from JSON.
WithInterceptorRegistry allows providing Interceptors to the API.
Settings should not be changed after passing the registry to an API.
WithMediaEngine allows providing a MediaEngine to the API.
Settings can be changed after passing the engine to an API.
When a PeerConnection is created the MediaEngine is copied
and no more changes can be made.
WithPayloader allows the user to override the Payloader.
WithRTPStreamID sets the RTP stream ID for this TrackLocalStaticRTP.
WithRTPTimestamp set the initial RTP timestamp for the track.
WithSettingEngine allows providing a SettingEngine to the API.
Settings should not be changed after passing the engine to an API.
Package-Level Variables (total 42)
ErrCertificateExpired indicates that an x509 certificate has expired.
ErrCodecAlreadyRegistered indicates that a codec has already been registered for the same payload type.
ErrCodecNotFound is returned when a codec search to the Media Engine fails.
ErrConnectionClosed indicates an operation executed after connection
has already been closed.
ErrDataChannelNotOpen indicates an operation executed when the data
channel is not (yet) open.
ErrExistingTrack indicates that a track already exists.
ErrFailedToGenerateCertificateFingerprint indicates that we failed to generate the fingerprint
used for comparing certificates.
ErrIncorrectSDPSemantics indicates that the PeerConnection was configured to
generate SDP Answers with different SDP Semantics than the received Offer.
ErrIncorrectSignalingState indicates that the signaling state of PeerConnection is not correct.
ErrMaxDataChannelID indicates that the maximum number ID that could be
specified for a data channel has been exceeded.
ErrModifyingBundlePolicy indicates that an attempt to modify
BundlePolicy was made after PeerConnection has been initialized.
ErrModifyingCertificates indicates that an attempt to modify
Certificates was made after PeerConnection has been initialized.
ErrModifyingICECandidatePoolSize indicates that an attempt to modify
ICECandidatePoolSize was made after PeerConnection has been initialized.
ErrModifyingPeerIdentity indicates that an attempt to modify
PeerIdentity was made after PeerConnection has been initialized.
ErrModifyingRTCPMuxPolicy indicates that an attempt to modify
RTCPMuxPolicy was made after PeerConnection has been initialized.
ErrNegotiatedWithoutID indicates that an attempt to create a data channel
was made while setting the negotiated option to true without providing
the negotiated channel ID.
ErrNoCodecsAvailable indicates that operation isn't possible because the MediaEngine has no codecs available.
ErrNoPayloaderForCodec indicates that the requested codec does not have a payloader.
ErrNoRemoteDescription indicates that an operation was rejected because
the remote description is not set.
ErrNoSRTPProtectionProfile indicates that the DTLS handshake completed and no SRTP Protection Profile was chosen.
ErrNoTurnCredentials indicates that a TURN server URL was provided
without required credentials.
ErrPrivateKeyType indicates that a particular private key encryption
chosen to generate a certificate is not supported.
ErrProtocolTooLarge indicates that value given for a DataChannelInit protocol is
longer then 65535 bytes.
ErrRegisterHeaderExtensionInvalidDirection indicates that a extension was
registered with a direction besides `sendonly` or `recvonly`.
ErrRetransmitsOrPacketLifeTime indicates that an attempt to create a data
channel was made with both options MaxPacketLifeTime and MaxRetransmits
set together. Such configuration is not supported by the specification
and is mutually exclusive.
ErrRTPSenderNewTrackHasIncorrectEnvelope indicates that the new track has a different envelope
than the previous/original.
ErrRTPSenderNewTrackHasIncorrectKind indicates that the new track is of a different kind than the previous/original.
ErrSenderNotCreatedByConnection indicates RemoveTrack was called with a RtpSender not created
by this PeerConnection.
ErrSenderWithNoCodecs indicates that a RTPSender was created without any codecs. To send media the MediaEngine
needs at least one configured codec.
ErrSessionDescriptionConflictingFingerprints indicates SetRemoteDescription was called with a SessionDescription
that has an conflicting fingerprints.
ErrSessionDescriptionConflictingIcePwd indicates SetRemoteDescription was called with a SessionDescription
that contains multiple conflicting ice-pwd values.
ErrSessionDescriptionConflictingIceUfrag indicates SetRemoteDescription was called with a SessionDescription
that contains multiple conflicting ice-ufrag values.
ErrSessionDescriptionInvalidFingerprint indicates SetRemoteDescription was called with a SessionDescription that
has an invalid fingerprint.
ErrSessionDescriptionMissingIcePwd indicates SetRemoteDescription was called with a SessionDescription that
is missing an ice-pwd value.
ErrSessionDescriptionMissingIceUfrag indicates SetRemoteDescription was called with a SessionDescription that
is missing an ice-ufrag value.
ErrSessionDescriptionNoFingerprint indicates SetRemoteDescription was called with a SessionDescription that has no
fingerprint.
ErrSimulcastProbeOverflow indicates that too many Simulcast probe streams are in flight
and the requested SSRC was ignored.
ErrStringSizeLimit indicates that the character size limit of string is
exceeded. The limit is hardcoded to 65535 according to specifications.
ErrTurnCredentials indicates that provided TURN credentials are partial
or malformed.
ErrUnbindFailed indicates that a TrackLocal was not able to be unbind.
ErrUnknownType indicates an error with Unknown info.
ErrUnsupportedCodec indicates the remote peer doesn't support the requested codec.
Package-Level Constants (total 158)
AttributeRtxPayloadType is the interceptor attribute added when Read()
returns an RTX packet containing the RTX stream payload type.
AttributeRtxSequenceNumber is the interceptor attribute added when
Read() returns an RTX packet containing the RTX stream sequence number.
AttributeRtxSsrc is the interceptor attribute added when Read()
returns an RTX packet containing the RTX stream SSRC.
BundlePolicyBalanced indicates to gather ICE candidates for each
media type in use (audio, video, and data). If the remote endpoint is
not bundle-aware, negotiate only one audio and video track on separate
transports.
BundlePolicyMaxBundle indicates to gather ICE candidates for only
one track. If the remote endpoint is not bundle-aware, negotiate only
one media track.
BundlePolicyMaxCompat indicates to gather ICE candidates for each
track. If the remote endpoint is not bundle-aware, negotiate all media
tracks on separate transports.
BundlePolicyUnknown is the enum's zero-value.
CodecTypeDecode means the attached CodecStats represents a media format
that the implementation is prepared to decode.
CodecTypeEncode means the attached CodecStats represents a media format that
is being encoded, or that the implementation is prepared to encode.
DataChannelStateClosed indicates that the underlying data transport
has been closed or could not be established.
DataChannelStateClosing indicates that the procedure to close down the
underlying data transport has started.
DataChannelStateConnecting indicates that the data channel is being
established. This is the initial state of DataChannel, whether created
with CreateDataChannel, or dispatched as a part of an DataChannelEvent.
DataChannelStateOpen indicates that the underlying data transport is
established and communication is possible.
DataChannelStateUnknown is the enum's zero-value.
DTLSRoleAuto defines the DTLS role is determined based on
the resolved ICE role: the ICE controlled role acts as the DTLS
client and the ICE controlling role acts as the DTLS server.
DTLSRoleClient defines the DTLS client role.
DTLSRoleServer defines the DTLS server role.
DTLSRoleUnknown is the enum's zero-value.
DTLSTransportStateClosed indicates that the transport has been closed
intentionally as the result of receipt of a close_notify alert, or
calling close().
DTLSTransportStateConnected indicates that DTLS has completed
negotiation of a secure connection and verified the remote fingerprint.
DTLSTransportStateConnecting indicates that DTLS is in the process of
negotiating a secure connection and verifying the remote fingerprint.
DTLSTransportStateFailed indicates that the transport has failed as
the result of an error (such as receipt of an error alert or failure to
validate the remote fingerprint).
DTLSTransportStateNew indicates that DTLS has not started negotiating
yet.
DTLSTransportStateUnknown is the enum's zero-value.
ICECandidateTypeHost indicates that the candidate is of Host type as
described in https://tools.ietf.org/html/rfc8445#section-5.1.1.1. A
candidate obtained by binding to a specific port from an IP address on
the host. This includes IP addresses on physical interfaces and logical
ones, such as ones obtained through VPNs.
ICECandidateTypePrflx indicates that the candidate is of Peer
Reflexive type. A candidate type whose IP address and port are a binding
allocated by a NAT for an ICE agent after it sends a packet through the
NAT to its peer.
ICECandidateTypeSrflx indicates the candidate is of Server
Reflexive type as described
https://tools.ietf.org/html/rfc8445#section-5.1.1.2. A candidate type
whose IP address and port are a binding allocated by a NAT for an ICE
agent after it sends a packet through the NAT to a server, such as a
STUN server.
ICECandidateTypeUnknown is the enum's zero-value.
ICEComponentRTCP indicates that the ICE Transport is used for RTCP as
defined by https://tools.ietf.org/html/rfc5245#section-4.1.1.1. This
represents the component-id value 2 when encoded in candidate-attribute.
ICEComponentRTP indicates that the ICE Transport is used for RTP (or
RTCP multiplexing), as defined in
https://tools.ietf.org/html/rfc5245#section-4.1.1.1. Protocols
multiplexed with RTP (e.g. data channel) share its component ID. This
represents the component-id value 1 when encoded in candidate-attribute.
ICEComponentUnknown is the enum's zero-value.
ICEConnectionStateChecking indicates that any of the ICETransports
are in the "checking" state and none of them are in the "disconnected"
or "failed" state.
ICEConnectionStateClosed indicates that the PeerConnection's
isClosed is true.
ICEConnectionStateCompleted indicates that all ICETransports are
in the "completed" or "closed" state and at least one of them is in the
"completed" state.
ICEConnectionStateConnected indicates that all ICETransports are
in the "connected", "completed" or "closed" state and at least one of
them is in the "connected" state.
ICEConnectionStateDisconnected indicates that any of the
ICETransports are in the "disconnected" state and none of them are
in the "failed" state.
ICEConnectionStateFailed indicates that any of the ICETransports
are in the "failed" state.
ICEConnectionStateNew indicates that any of the ICETransports are
in the "new" state and none of them are in the "checking", "disconnected"
or "failed" state, or all ICETransports are in the "closed" state, or
there are no transports.
ICEConnectionStateUnknown is the enum's zero-value.
ICEGathererStateClosed indicates the closed state can only be entered
when the ICEGatherer has been closed intentionally by calling close().
ICEGathererStateComplete indicates the ICEGatherer has completed gathering.
ICEGathererStateGathering indicates gather() has been called,
and the ICEGatherer is in the process of gathering candidates.
ICEGathererStateNew indicates object has been created but
gather() has not been called.
ICEGathererStateUnknown is the enum's zero-value.
ICEGatheringStateComplete indicates that at least one ICETransport
exists, and all ICETransports are in the "completed" gathering state.
ICEGatheringStateGathering indicates that any of the ICETransports
are in the "gathering" state.
ICEGatheringStateNew indicates that any of the ICETransports are
in the "new" gathering state and none of the transports are in the
"gathering" state, or there are no transports.
ICEGatheringStateUnknown is the enum's zero-value.
ICEProtocolTCP indicates the URL uses a TCP transport.
ICEProtocolUDP indicates the URL uses a UDP transport.
ICEProtocolUnknown is the enum's zero-value.
ICERoleControlled indicates that an ICE agent that waits for the
controlling agent to select the final choice of candidate pairs.
ICERoleControlling indicates that the ICE agent that is responsible
for selecting the final choice of candidate pairs and signaling them
through STUN and an updated offer, if needed. In any session, one agent
is always controlling. The other is the controlled agent.
ICERoleUnknown is the enum's zero-value.
ICETransportPolicyAll indicates any type of candidate is used.
ICETransportPolicyRelay indicates only media relay candidates such
as candidates passing through a TURN server are used.
ICETransportStateChecking indicates the ICETransport has
received at least one remote candidate, and a local and remote
ICECandidateComplete dictionary was not added as the last candidate.
ICETransportStateClosed indicates the ICETransport has shut down
and is no longer responding to STUN requests.
ICETransportStateCompleted indicates the ICETransport tested
all appropriate candidate pairs and at least one functioning
candidate pair has been found.
ICETransportStateConnected indicates the ICETransport has
received a response to an outgoing connectivity check, or has
received incoming DTLS/media after a successful response to an
incoming connectivity check, but is still checking other candidate
pairs to see if there is a better connection.
ICETransportStateDisconnected indicates the ICETransport has received
at least one local and remote candidate, but the final candidate was
received yet and all appropriate candidate pairs thus far have been
tested and failed.
ICETransportStateFailed indicates the ICETransport the last
candidate was added and all appropriate candidate pairs have either
failed connectivity checks or have lost consent.
ICETransportStateNew indicates the ICETransport is waiting
for remote candidates to be supplied.
ICETransportStateUnknown is the enum's zero-value.
MediaKindAudio indicates this is audio stats.
MediaKindVideo indicates this is video stats.
MimeTypeAV1 AV1 MIME type
Note: Matching should be case insensitive.
MimeTypeFlexFEC FEC MIME Type
Note: Matching should be case insensitive.
MimeTypeFlexFEC03 FlexFEC03 MIME Type
Note: Matching should be case insensitive.
MimeTypeG722 G722 MIME type
Note: Matching should be case insensitive.
MimeTypeH264 H264 MIME type.
Note: Matching should be case insensitive.
MimeTypeH265 H265 MIME type
Note: Matching should be case insensitive.
MimeTypeOpus Opus MIME type
Note: Matching should be case insensitive.
MimeTypePCMA PCMA MIME type
Note: Matching should be case insensitive.
MimeTypePCMU PCMU MIME type
Note: Matching should be case insensitive.
MimeTypeRTX RTX MIME type
Note: Matching should be case insensitive.
MimeTypeUlpFEC UlpFEC MIME Type
Note: Matching should be case insensitive.
MimeTypeVP8 VP8 MIME type
Note: Matching should be case insensitive.
MimeTypeVP9 VP9 MIME type
Note: Matching should be case insensitive.
NetworkTypeTCP4 indicates TCP over IPv4.
NetworkTypeTCP6 indicates TCP over IPv6.
NetworkTypeUDP4 indicates UDP over IPv4.
NetworkTypeUDP6 indicates UDP over IPv6.
NetworkTypeUnknown is the enum's zero-value.
PeerConnectionStateClosed indicates the peer connection is closed
and the isClosed member variable of PeerConnection is true.
PeerConnectionStateConnected indicates that all ICETransports and
DTLSTransports are in the "connected", "completed" or "closed" state
and at least one of them is in the "connected" or "completed" state.
PeerConnectionStateConnecting indicates that any of the
ICETransports or DTLSTransports are in the "connecting" or
"checking" state and none of them is in the "failed" state.
PeerConnectionStateDisconnected indicates that any of the
ICETransports or DTLSTransports are in the "disconnected" state
and none of them are in the "failed" or "connecting" or "checking" state.
PeerConnectionStateFailed indicates that any of the ICETransports
or DTLSTransports are in a "failed" state.
PeerConnectionStateNew indicates that any of the ICETransports or
DTLSTransports are in the "new" state and none of the transports are
in the "connecting", "checking", "failed" or "disconnected" state, or
all transports are in the "closed" state, or there are no transports.
PeerConnectionStateUnknown is the enum's zero-value.
QualityLimitationReasonBandwidth means the resolution and/or framerate is primarily limited
due to congestion cues during bandwidth estimation.
Typical, congestion control algorithms use inter-arrival time, round-trip time,
packet or other congestion cues to perform bandwidth estimation.
QualityLimitationReasonCPU means the resolution and/or framerate is primarily limited due to CPU load.
QualityLimitationReasonNone means the resolution and/or framerate is not limited.
QualityLimitationReasonOther means the resolution and/or framerate is primarily limited
for a reason other than the above.
RTCPMuxPolicyNegotiate indicates to gather ICE candidates for both
RTP and RTCP candidates. If the remote-endpoint is capable of
multiplexing RTCP, multiplex RTCP on the RTP candidates. If it is not,
use both the RTP and RTCP candidates separately.
RTCPMuxPolicyRequire indicates to gather ICE candidates only for
RTP and multiplex RTCP on the RTP candidates. If the remote endpoint is
not capable of rtcp-mux, session negotiation will fail.
RTCPMuxPolicyUnknown is the enum's zero-value.
RTPCodecTypeAudio indicates this is an audio codec.
RTPCodecTypeUnknown is the enum's zero-value.
RTPCodecTypeVideo indicates this is a video codec.
RTPTransceiverDirectionInactive indicates the RTPSender won't offer
to send RTP and the RTPReceiver won't offer to receive RTP.
RTPTransceiverDirectionRecvonly indicates the RTPReceiver will
offer to receive RTP.
RTPTransceiverDirectionSendonly indicates the RTPSender will offer
to send RTP.
RTPTransceiverDirectionSendrecv indicates the RTPSender will offer
to send RTP and the RTPReceiver will offer to receive RTP.
RTPTransceiverDirectionUnknown is the enum's zero-value.
SCTPTransportStateClosed indicates a SHUTDOWN or ABORT chunk is
received or when the SCTP association has been closed intentionally,
such as by closing the peer connection or applying a remote description
that rejects data or changes the SCTP port.
SCTPTransportStateConnected indicates the negotiation of an
association is completed.
SCTPTransportStateConnecting indicates the SCTPTransport is in the
process of negotiating an association. This is the initial state of the
SCTPTransportState when an SCTPTransport is created.
SCTPTransportStateUnknown is the enum's zero-value.
SDPSemanticsUnifiedPlanWithFallback prefers unified-plan
offers and answers, but will respond to a plan-b offer
with a plan-b answer.
SDPTypeAnswer indicates that a description MUST be treated as an SDP
final answer, and the offer-answer exchange MUST be considered complete.
A description used as an SDP answer may be applied as a response to an
SDP offer or as an update to a previously sent SDP pranswer.
SDPTypeOffer indicates that a description MUST be treated as an SDP offer.
SDPTypePranswer indicates that a description MUST be treated as an
SDP answer, but not a final answer. A description used as an SDP
pranswer may be applied as a response to an SDP offer, or an update to
a previously sent SDP pranswer.
SDPTypeRollback indicates that a description MUST be treated as
canceling the current SDP negotiation and moving the SDP offer and
answer back to what it was in the previous stable state. Note the
local or remote SDP descriptions in the previous stable state could be
null if there has not yet been a successful offer-answer negotiation.
SDPTypeUnknown is the enum's zero-value.
SignalingStateClosed indicates The PeerConnection has been closed.
SignalingStateHaveLocalOffer indicates that a local description, of
type "offer", has been successfully applied.
SignalingStateHaveLocalPranswer indicates that a remote description
of type "offer" has been successfully applied and a local description
of type "pranswer" has been successfully applied.
SignalingStateHaveRemoteOffer indicates that a remote description, of
type "offer", has been successfully applied.
SignalingStateHaveRemotePranswer indicates that a local description
of type "offer" has been successfully applied and a remote description
of type "pranswer" has been successfully applied.
SignalingStateStable indicates there is no offer/answer exchange in
progress. This is also the initial state, in which case the local and
remote descriptions are nil.
SignalingStateUnknown is the enum's zero-value.
StatsICECandidatePairStateFailed means a check for this pair was already done
and failed, either never producing any response or producing an unrecoverable
failure response.
StatsICECandidatePairStateFrozen means a check for this pair hasn't been
performed, and it can't yet be performed until some other check succeeds,
allowing this pair to unfreeze and move into the Waiting state.
StatsICECandidatePairStateInProgress means a check has been sent for this pair,
but the transaction is in progress.
StatsICECandidatePairStateSucceeded means a check for this pair was already
done and produced a successful result.
StatsICECandidatePairStateWaiting means a check has not been performed for
this pair, and can be performed as soon as it is the highest-priority Waiting
pair on the check list.
StatsTypeCandidatePair is used by ICECandidatePairStats.
StatsTypeCertificate is used by CertificateStats.
StatsTypeCodec is used by CodecStats.
StatsTypeCSRC is used by RTPContributingSourceStats.
StatsTypeDataChannel is used by DataChannelStats.
StatsTypeInboundRTP is used by InboundRTPStreamStats.
StatsTypeLocalCandidate is used by ICECandidateStats for the local candidate.
StatsTypeMediaPlayout is used by AudioPlayoutStats.
StatsTypeMediaSource is used by AudioSourceStats or VideoSourceStats depending on kind.
StatsTypeOutboundRTP is used by OutboundRTPStreamStats.
StatsTypePeerConnection used by PeerConnectionStats.
StatsTypeReceiver is used by the AudioReceiverStats or VideoReceiverStats depending on kind.
StatsTypeRemoteCandidate is used by ICECandidateStats for the remote candidate.
StatsTypeRemoteInboundRTP is used by RemoteInboundRTPStreamStats.
StatsTypeRemoteOutboundRTP is used by RemoteOutboundRTPStreamStats.
StatsTypeSCTPTransport is used by SCTPTransportStats.
StatsTypeSender is used by the AudioSenderStats or VideoSenderStats depending on kind.
StatsTypeStream is used by MediaStreamStats.
StatsTypeTrack is used by SenderVideoTrackAttachmentStats and SenderAudioTrackAttachmentStats depending on kind.
StatsTypeTransport is used by TransportStats.
TypeRTCPFBACK ..
TypeRTCPFBCCM ..
TypeRTCPFBGoogREMB ..
TypeRTCPFBNACK ..
TypeRTCPFBTransportCC ..
The pages are generated with Goldsv0.8.2. (GOOS=linux GOARCH=amd64)
Golds is a Go 101 project developed by Tapir Liu.
PR and bug reports are welcome and can be submitted to the issue list.
Please follow @zigo_101 (reachable from the left QR code) to get the latest news of Golds.