Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

fix negotiation typo #2538

Merged
merged 1 commit into from
Aug 24, 2023
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
2 changes: 1 addition & 1 deletion examples/README.md
Original file line number Diff line number Diff line change
Expand Up @@ -10,7 +10,7 @@ For more full featured examples that use 3rd party libraries see our **[example-
#### Media API
* [Reflect](reflect): The reflect example demonstrates how to have Pion send back to the user exactly what it receives using the same PeerConnection.
* [Play from Disk](play-from-disk): The play-from-disk example demonstrates how to send video to your browser from a file saved to disk.
* [Play from Disk Renegotation](play-from-disk-renegotation): The play-from-disk-renegotation example is an extension of the play-from-disk example, but demonstrates how you can add/remove video tracks from an already negotiated PeerConnection.
* [Play from Disk Renegotiation](play-from-disk-renegotiation): The play-from-disk-renegotiation example is an extension of the play-from-disk example, but demonstrates how you can add/remove video tracks from an already negotiated PeerConnection.
* [Insertable Streams](insertable-streams): The insertable-streams example demonstrates how Pion can be used to send E2E encrypted video and decrypt via insertable streams in the browser.
* [Save to Disk](save-to-disk): The save-to-disk example shows how to record your webcam and save the footage to disk on the server side.
* [Broadcast](broadcast): The broadcast example demonstrates how to broadcast a video to multiple peers. A broadcaster uploads the video once and the server forwards it to all other peers.
Expand Down
4 changes: 2 additions & 2 deletions examples/examples.json
Original file line number Diff line number Diff line change
Expand Up @@ -36,9 +36,9 @@
"type": "browser"
},
{
"title": "Play from Disk Renegotation",
"title": "Play from Disk Renegotiation",
"link": "play-from-disk",
"description": "The play-from-disk-renegotation example is an extension of the play-from-disk example, but demonstrates how you can add/remove video tracks from an already negotiated PeerConnection.",
"description": "The play-from-disk-renegotiation example is an extension of the play-from-disk example, but demonstrates how you can add/remove video tracks from an already negotiated PeerConnection.",
"type": "browser"
},
{
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,7 @@
SPDX-License-Identifier: MIT
-->
<head>
<title>play-from-disk-renegotation</title>
<title>play-from-disk-renegotiation</title>
</head>

<body>
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,7 @@
//go:build !js
// +build !js

// play-from-disk-renegotation demonstrates Pion WebRTC's renegotiation abilities.
// play-from-disk-renegotiation demonstrates Pion WebRTC's renegotiation abilities.
package main

import (
Expand Down
6 changes: 3 additions & 3 deletions peerconnection.go
Original file line number Diff line number Diff line change
Expand Up @@ -1039,7 +1039,7 @@ func (pc *PeerConnection) SetRemoteDescription(desc SessionDescription) error {
return &rtcerr.InvalidStateError{Err: ErrConnectionClosed}
}

isRenegotation := pc.currentRemoteDescription != nil
isRenegotiation := pc.currentRemoteDescription != nil

if _, err := desc.Unmarshal(); err != nil {
return err
Expand Down Expand Up @@ -1142,7 +1142,7 @@ func (pc *PeerConnection) SetRemoteDescription(desc SessionDescription) error {
return err
}

if isRenegotation && pc.iceTransport.haveRemoteCredentialsChange(remoteUfrag, remotePwd) {
if isRenegotiation && pc.iceTransport.haveRemoteCredentialsChange(remoteUfrag, remotePwd) {
// An ICE Restart only happens implicitly for a SetRemoteDescription of type offer
if !weOffer {
if err = pc.iceTransport.restart(); err != nil {
Expand All @@ -1163,7 +1163,7 @@ func (pc *PeerConnection) SetRemoteDescription(desc SessionDescription) error {

currentTransceivers := append([]*RTPTransceiver{}, pc.GetTransceivers()...)

if isRenegotation {
if isRenegotiation {
if weOffer {
_ = setRTPTransceiverCurrentDirection(&desc, currentTransceivers, true)
if err = pc.startRTPSenders(currentTransceivers); err != nil {
Expand Down
4 changes: 2 additions & 2 deletions peerconnection_renegotiation_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -716,7 +716,7 @@ func TestPeerConnection_Renegotiation_SetLocalDescription(t *testing.T) {
}

// Issue #346, don't start the SCTP Subsystem if the RemoteDescription doesn't contain one
// Before we would always start it, and re-negotations would fail because SCTP was in flight
// Before we would always start it, and re-negotiations would fail because SCTP was in flight
func TestPeerConnection_Renegotiation_NoApplication(t *testing.T) {
signalPairExcludeDataChannel := func(pcOffer, pcAnswer *PeerConnection) {
offer, err := pcOffer.CreateOffer(nil)
Expand Down Expand Up @@ -785,7 +785,7 @@ func TestPeerConnection_Renegotiation_NoApplication(t *testing.T) {
closePairNow(t, pcOffer, pcAnswer)
}

func TestAddDataChannelDuringRenegotation(t *testing.T) {
func TestAddDataChannelDuringRenegotiation(t *testing.T) {
lim := test.TimeOut(time.Second * 10)
defer lim.Stop()

Expand Down
Loading