Various spell fixes

For error types, vars, docs and comments
This commit is contained in:
Vicken Simonian
2019-10-17 22:28:14 -07:00
committed by Sean DuBois
parent 27f93a7f3d
commit 5f25df2209
17 changed files with 55 additions and 57 deletions

View File

@@ -35,7 +35,7 @@ Check out the **[example applications](examples/README.md)** to help you along y
For more full featured examples that use 3rd party libraries see our **[example-webrtc-applications](https://github.com/pion/example-webrtc-applications)** repo.
The Pion WebRTC API closely matches the JavaScript **[WebRTC API](https://w3c.github.io/webrtc-pc/)**. Most existing documentation is therefore also usefull when working with Pion. Furthermore, our **[GoDoc](https://godoc.org/github.com/pion/webrtc)** is actively maintained.
The Pion WebRTC API closely matches the JavaScript **[WebRTC API](https://w3c.github.io/webrtc-pc/)**. Most existing documentation is therefore also useful when working with Pion. Furthermore, our **[GoDoc](https://godoc.org/github.com/pion/webrtc)** is actively maintained.
We maintain a [FAQ](https://pion.ly/knowledge-base/pion-basics/faq/) with answers to common questions. If you have a question not covered please submit a PR, we would be happy to answer it!

View File

@@ -15,7 +15,7 @@ import (
)
const dataChannelBufferSize = math.MaxUint16 //message size limit for Chromium
var errSCTPNotEstablished = errors.New("SCTP not establisched")
var errSCTPNotEstablished = errors.New("SCTP not established")
// DataChannel represents a WebRTC DataChannel
// The DataChannel interface represents a network channel
@@ -112,7 +112,7 @@ func (d *DataChannel) open(sctpTransport *SCTPTransport) error {
}
var channelType datachannel.ChannelType
var reliabilityParameteer uint32
var reliabilityParameter uint32
switch {
case d.maxPacketLifeTime == nil && d.maxRetransmits == nil:
@@ -123,14 +123,14 @@ func (d *DataChannel) open(sctpTransport *SCTPTransport) error {
}
case d.maxRetransmits != nil:
reliabilityParameteer = uint32(*d.maxRetransmits)
reliabilityParameter = uint32(*d.maxRetransmits)
if d.ordered {
channelType = datachannel.ChannelTypePartialReliableRexmit
} else {
channelType = datachannel.ChannelTypePartialReliableRexmitUnordered
}
default:
reliabilityParameteer = uint32(*d.maxPacketLifeTime)
reliabilityParameter = uint32(*d.maxPacketLifeTime)
if d.ordered {
channelType = datachannel.ChannelTypePartialReliableTimed
} else {
@@ -141,7 +141,7 @@ func (d *DataChannel) open(sctpTransport *SCTPTransport) error {
cfg := &datachannel.Config{
ChannelType: channelType,
Priority: datachannel.ChannelPriorityNormal,
ReliabilityParameter: reliabilityParameteer,
ReliabilityParameter: reliabilityParameter,
Label: d.label,
Protocol: d.protocol,
Negotiated: d.negotiated,

View File

@@ -249,7 +249,7 @@ func TestDataChannelBufferedAmount(t *testing.T) {
if e != nil {
t.Fatalf("Failed to send string on data channel")
}
assert.Equal(t, uint64(1500), dc.BufferedAmountLowThreshold(), "value mimatch")
assert.Equal(t, uint64(1500), dc.BufferedAmountLowThreshold(), "value mismatch")
//assert.Equal(t, (i+1)*len(buf), int(dc.BufferedAmount()), "unexpected bufferedAmount")
}
@@ -331,7 +331,7 @@ func TestDataChannelBufferedAmount(t *testing.T) {
if e != nil {
t.Fatalf("Failed to send string on data channel")
}
assert.Equal(t, uint64(1500), dc.BufferedAmountLowThreshold(), "value mimatch")
assert.Equal(t, uint64(1500), dc.BufferedAmountLowThreshold(), "value mismatch")
//assert.Equal(t, (i+1)*len(buf), int(dc.BufferedAmount()), "unexpected bufferedAmount")
}

View File

@@ -8,7 +8,7 @@ import (
type DTLSRole byte
const (
// DTLSRoleAuto defines the DLTS role is determined based on
// 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.
DTLSRoleAuto DTLSRole = iota + 1

View File

@@ -241,7 +241,7 @@ func (t *DTLSTransport) Start(remoteParameters DTLSParameters) error {
// pion/webrtc#753
cert := t.certificates[0]
dtlsCofig := &dtls.Config{
dtlsConfig := &dtls.Config{
Certificate: cert.x509Cert,
PrivateKey: cert.privateKey,
SRTPProtectionProfiles: []dtls.SRTPProtectionProfile{dtls.SRTP_AES128_CM_HMAC_SHA1_80},
@@ -253,7 +253,7 @@ func (t *DTLSTransport) Start(remoteParameters DTLSParameters) error {
t.onStateChange(DTLSTransportStateConnecting)
if t.isClient() {
// Assumes the peer offered to be passive and we accepted.
dtlsConn, err := dtls.Client(dtlsEndpoint, dtlsCofig)
dtlsConn, err := dtls.Client(dtlsEndpoint, dtlsConfig)
if err != nil {
t.onStateChange(DTLSTransportStateFailed)
return err
@@ -261,7 +261,7 @@ func (t *DTLSTransport) Start(remoteParameters DTLSParameters) error {
t.conn = dtlsConn
} else {
// Assumes we offer to be passive and this is accepted.
dtlsConn, err := dtls.Server(dtlsEndpoint, dtlsCofig)
dtlsConn, err := dtls.Server(dtlsEndpoint, dtlsConfig)
if err != nil {
t.onStateChange(DTLSTransportStateFailed)
return err

View File

@@ -1,6 +1,6 @@
package webrtc
// DTLSTransportState indicates the dtsl transport establishment state.
// DTLSTransportState indicates the DTLS transport establishment state.
type DTLSTransportState int
const (

View File

@@ -48,7 +48,7 @@ Once the data channel is successfully opened, offerPC will start sending a serie
Here's how to run the code.
At the root of the example, `pion/webrtcp/examples/data-channels-flow-control/`:
At the root of the example, `pion/webrtc/examples/data-channels-flow-control/`:
```
$ go run main.go
2019/08/31 14:56:41 OnOpen: data-824635025728. Start sending a series of 1024-byte packets as fast as it can
@@ -61,5 +61,3 @@ $ go run main.go
2019/08/31 14:56:47 Throughput: 218.342 Mbps
:
```

View File

@@ -89,7 +89,7 @@ func getCandidateType(candidateType ice.CandidateType) (ICECandidateType, error)
default:
// NOTE: this should never happen[tm]
err := fmt.Errorf(
"cannot convert ice.CandidateType into webrtc.ICECandidateType, invalid typej: %s",
"cannot convert ice.CandidateType into webrtc.ICECandidateType, invalid type: %s",
candidateType.String())
return ICECandidateType(Unknown), err
}

View File

@@ -289,7 +289,7 @@ func (g *ICEGatherer) getAgent() *ice.Agent {
return g.agent
}
// SignalCandidates imitates gathering process to backward support old tricle
// SignalCandidates imitates gathering process to backward support old trickle
// false behavior.
func (g *ICEGatherer) SignalCandidates() error {
candidates, err := g.GetLocalCandidates()

View File

@@ -856,8 +856,8 @@ func (pc *PeerConnection) SetLocalDescription(desc SessionDescription) error {
// To support all unittests which are following the future trickle=true
// setup while also support the old trickle=false synchronous gathering
// process this is necessary to avoid calling Garther() in multiple
// pleces; which causes race conditions. (issue-707)
// process this is necessary to avoid calling Gather() in multiple
// places; which causes race conditions. (issue-707)
if !pc.iceGatherer.agentIsTrickle {
if err := pc.iceGatherer.SignalCandidates(); err != nil {
return err

View File

@@ -343,7 +343,7 @@ func TestPeerConnection_ShutdownNoDTLS(t *testing.T) {
}
}
func TestPeerConnection_PeropertyGetters(t *testing.T) {
func TestPeerConnection_PropertyGetters(t *testing.T) {
pc := &PeerConnection{
currentLocalDescription: &SessionDescription{},
pendingLocalDescription: &SessionDescription{},
@@ -419,7 +419,7 @@ func TestPeerConnection_satisfyTypeAndDirection(t *testing.T) {
[]*RTPTransceiver{createTransceiver(RTPCodecTypeVideo, RTPTransceiverDirectionRecvonly)},
},
{
"Don't satisify a Sendonly with a SendRecv, later SendRecv will be marked as Inactive",
"Don't satisfy a Sendonly with a SendRecv, later SendRecv will be marked as Inactive",
[]RTPCodecType{RTPCodecTypeVideo, RTPCodecTypeVideo},
[]RTPTransceiverDirection{RTPTransceiverDirectionSendonly, RTPTransceiverDirectionSendrecv},

View File

@@ -18,12 +18,12 @@ type PeerConnection struct {
// Keep track of handlers/callbacks so we can call Release as required by the
// syscall/js API. Initially nil.
onSignalingStateChangeHandler *js.Func
onDataChannelHandler *js.Func
onConectionStateChangeHandler *js.Func
onICEConectionStateChangeHandler *js.Func
onICECandidateHandler *js.Func
onICEGatheringStateChangeHandler *js.Func
onSignalingStateChangeHandler *js.Func
onDataChannelHandler *js.Func
onConnectionStateChangeHandler *js.Func
onICEConnectionStateChangeHandler *js.Func
onICECandidateHandler *js.Func
onICEGatheringStateChangeHandler *js.Func
// A reference to the associated API state used by this connection
api *API
@@ -94,33 +94,33 @@ func (pc *PeerConnection) OnDataChannel(f func(*DataChannel)) {
// OnICEConnectionStateChange sets an event handler which is called
// when an ICE connection state is changed.
func (pc *PeerConnection) OnICEConnectionStateChange(f func(ICEConnectionState)) {
if pc.onICEConectionStateChangeHandler != nil {
oldHandler := pc.onICEConectionStateChangeHandler
if pc.onICEConnectionStateChangeHandler != nil {
oldHandler := pc.onICEConnectionStateChangeHandler
defer oldHandler.Release()
}
onICEConectionStateChangeHandler := js.FuncOf(func(this js.Value, args []js.Value) interface{} {
onICEConnectionStateChangeHandler := js.FuncOf(func(this js.Value, args []js.Value) interface{} {
connectionState := NewICEConnectionState(pc.underlying.Get("iceConnectionState").String())
go f(connectionState)
return js.Undefined()
})
pc.onICEConectionStateChangeHandler = &onICEConectionStateChangeHandler
pc.underlying.Set("oniceconnectionstatechange", onICEConectionStateChangeHandler)
pc.onICEConnectionStateChangeHandler = &onICEConnectionStateChangeHandler
pc.underlying.Set("oniceconnectionstatechange", onICEConnectionStateChangeHandler)
}
// OnConnectionStateChange sets an event handler which is called
// when an PeerConnectionState is changed.
func (pc *PeerConnection) OnConnectionStateChange(f func(PeerConnectionState)) {
if pc.onConectionStateChangeHandler != nil {
oldHandler := pc.onConectionStateChangeHandler
if pc.onConnectionStateChangeHandler != nil {
oldHandler := pc.onConnectionStateChangeHandler
defer oldHandler.Release()
}
onConectionStateChangeHandler := js.FuncOf(func(this js.Value, args []js.Value) interface{} {
onConnectionStateChangeHandler := js.FuncOf(func(this js.Value, args []js.Value) interface{} {
connectionState := newPeerConnectionState(pc.underlying.Get("connectionState").String())
go f(connectionState)
return js.Undefined()
})
pc.onConectionStateChangeHandler = &onConectionStateChangeHandler
pc.underlying.Set("onconnectionstatechange", onConectionStateChangeHandler)
pc.onConnectionStateChangeHandler = &onConnectionStateChangeHandler
pc.underlying.Set("onconnectionstatechange", onConnectionStateChangeHandler)
}
func (pc *PeerConnection) checkConfiguration(configuration Configuration) error {
@@ -374,11 +374,11 @@ func (pc *PeerConnection) Close() (err error) {
if pc.onDataChannelHandler != nil {
pc.onDataChannelHandler.Release()
}
if pc.onConectionStateChangeHandler != nil {
pc.onConectionStateChangeHandler.Release()
if pc.onConnectionStateChangeHandler != nil {
pc.onConnectionStateChangeHandler.Release()
}
if pc.onICEConectionStateChangeHandler != nil {
pc.onICEConectionStateChangeHandler.Release()
if pc.onICEConnectionStateChangeHandler != nil {
pc.onICEConnectionStateChangeHandler.Release()
}
if pc.onICECandidateHandler != nil {
pc.onICECandidateHandler.Release()

View File

@@ -67,8 +67,8 @@ func TestPeerConnection_Media_Sample(t *testing.T) {
awaitRTCPSenderRecv := make(chan bool)
awaitRTCPSenderSend := make(chan error)
awaitRTCPRecieverRecv := make(chan error)
awaitRTCPRecieverSend := make(chan error)
awaitRTCPReceiverRecv := make(chan error)
awaitRTCPReceiverSend := make(chan error)
trackMetadataValid := make(chan error)
@@ -88,13 +88,13 @@ func TestPeerConnection_Media_Sample(t *testing.T) {
for {
time.Sleep(time.Millisecond * 100)
if routineErr := pcAnswer.WriteRTCP([]rtcp.Packet{&rtcp.RapidResynchronizationRequest{SenderSSRC: track.SSRC(), MediaSSRC: track.SSRC()}}); routineErr != nil {
awaitRTCPRecieverSend <- routineErr
awaitRTCPReceiverSend <- routineErr
return
}
select {
case <-awaitRTCPSenderRecv:
close(awaitRTCPRecieverSend)
close(awaitRTCPReceiverSend)
return
default:
}
@@ -104,9 +104,9 @@ func TestPeerConnection_Media_Sample(t *testing.T) {
go func() {
_, routineErr := receiver.Read(make([]byte, 1400))
if routineErr != nil {
awaitRTCPRecieverRecv <- routineErr
awaitRTCPReceiverRecv <- routineErr
} else {
close(awaitRTCPRecieverRecv)
close(awaitRTCPReceiverRecv)
}
}()
@@ -156,7 +156,7 @@ func TestPeerConnection_Media_Sample(t *testing.T) {
}
select {
case <-awaitRTCPRecieverRecv:
case <-awaitRTCPReceiverRecv:
close(awaitRTCPSenderSend)
return
default:
@@ -189,8 +189,8 @@ func TestPeerConnection_Media_Sample(t *testing.T) {
t.Fatal(err)
}
<-awaitRTCPRecieverRecv
err, ok = <-awaitRTCPRecieverSend
<-awaitRTCPReceiverRecv
err, ok = <-awaitRTCPReceiverSend
if ok {
t.Fatal(err)
}
@@ -358,10 +358,10 @@ func TestPeerConnection_Media_Disconnected(t *testing.T) {
for {
if len(vp8Sender.Transport().GetRemoteCertificate()) != 0 {
pcAnswer.sctpTransport.lock.RLock()
haveAssocation := pcAnswer.sctpTransport.association != nil
haveAssociation := pcAnswer.sctpTransport.association != nil
pcAnswer.sctpTransport.lock.RUnlock()
if haveAssocation {
if haveAssociation {
break
}
}

View File

@@ -15,7 +15,7 @@ const (
pageHeaderTypeContinuationOfStream = 0x00
pageHeaderTypeBeginningOfStream = 0x02
pageHeaderTypeEndOfStream = 0x04
defaultPreSkip = 3840 // 3840 recommanded in the RFC
defaultPreSkip = 3840 // 3840 recommended in the RFC
idPageSignature = "OpusHead"
commentPageSignature = "OpusTags"
pageHeaderSignature = "OggS"

View File

@@ -92,7 +92,7 @@ func TestReader(t *testing.T) {
// packet header len=1048575
0xFF, 0xFF, 0x00, 0x00,
0x00, 0x00, 0x00, 0x00,
// packet paylaod
// packet payload
0x00,
),
WantHeader: Header{

View File

@@ -121,7 +121,7 @@ func (r *SCTPTransport) Stop() error {
func (r *SCTPTransport) ensureDTLS() error {
if r.dtlsTransport == nil ||
r.dtlsTransport.conn == nil {
return errors.New("DTLS not establisched")
return errors.New("DTLS not established")
}
return nil

View File

@@ -1341,7 +1341,7 @@ type ICECandidatePairStats struct {
// ResponsesReceived represents the total number of connectivity check responses received.
ResponsesReceived uint64 `json:"responsesReceived"`
// ResponsesSent epresents the total number of connectivity check responses sent.
// ResponsesSent represents the total number of connectivity check responses sent.
// Since we cannot distinguish connectivity check requests and consent requests,
// all responses are counted.
ResponsesSent uint64 `json:"responsesSent"`