Skip to content

Commit

Permalink
Remove deprecated APIs
Browse files Browse the repository at this point in the history
Delete everything that was marked as deprecated
  • Loading branch information
ourwarmhouse committed Sep 14, 2023
1 parent 23185c6 commit 52b3fb0
Show file tree
Hide file tree
Showing 5 changed files with 10 additions and 25 deletions.
4 changes: 2 additions & 2 deletions examples/vnet/show-network-usage/main.go
Original file line number Diff line number Diff line change
Expand Up @@ -96,7 +96,7 @@ func main() {
panicIfError(wan.AddNet(offerVNet))

offerSettingEngine := webrtc.SettingEngine{}
offerSettingEngine.SetVNet(offerVNet)
offerSettingEngine.SetNet(offerVNet)
offerAPI := webrtc.NewAPI(webrtc.WithSettingEngine(offerSettingEngine))

// Create a network interface for answerer
Expand All @@ -109,7 +109,7 @@ func main() {
panicIfError(wan.AddNet(answerVNet))

answerSettingEngine := webrtc.SettingEngine{}
answerSettingEngine.SetVNet(answerVNet)
answerSettingEngine.SetNet(answerVNet)
answerAPI := webrtc.NewAPI(webrtc.WithSettingEngine(answerSettingEngine))

// Start the virtual network by calling Start() on the root router
Expand Down
12 changes: 6 additions & 6 deletions peerconnection_renegotiation_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -1204,9 +1204,9 @@ func TestPeerConnection_Renegotiation_MidConflict(t *testing.T) {
_, err = offerPC.CreateDataChannel("test", nil)
assert.NoError(t, err)

_, err = offerPC.AddTransceiverFromKind(RTPCodecTypeVideo, RtpTransceiverInit{Direction: RTPTransceiverDirectionSendonly})
_, err = offerPC.AddTransceiverFromKind(RTPCodecTypeVideo, RTPTransceiverInit{Direction: RTPTransceiverDirectionSendonly})
assert.NoError(t, err)
_, err = offerPC.AddTransceiverFromKind(RTPCodecTypeAudio, RtpTransceiverInit{Direction: RTPTransceiverDirectionSendonly})
_, err = offerPC.AddTransceiverFromKind(RTPCodecTypeAudio, RTPTransceiverInit{Direction: RTPTransceiverDirectionSendonly})
assert.NoError(t, err)

offer, err := offerPC.CreateOffer(nil)
Expand All @@ -1219,10 +1219,10 @@ func TestPeerConnection_Renegotiation_MidConflict(t *testing.T) {
assert.NoError(t, offerPC.SetRemoteDescription(answer))
assert.Equal(t, SignalingStateStable, offerPC.SignalingState())

tr, err := offerPC.AddTransceiverFromKind(RTPCodecTypeVideo, RtpTransceiverInit{Direction: RTPTransceiverDirectionSendonly})
tr, err := offerPC.AddTransceiverFromKind(RTPCodecTypeVideo, RTPTransceiverInit{Direction: RTPTransceiverDirectionSendonly})
assert.NoError(t, err)
assert.NoError(t, tr.SetMid("3"))
_, err = offerPC.AddTransceiverFromKind(RTPCodecTypeVideo, RtpTransceiverInit{Direction: RTPTransceiverDirectionSendrecv})
_, err = offerPC.AddTransceiverFromKind(RTPCodecTypeVideo, RTPTransceiverInit{Direction: RTPTransceiverDirectionSendrecv})
assert.NoError(t, err)
_, err = offerPC.CreateOffer(nil)
assert.NoError(t, err)
Expand Down Expand Up @@ -1257,13 +1257,13 @@ func TestPeerConnection_Regegotiation_AnswerAddsTrack(t *testing.T) {
assert.NoError(t, err)
assert.NoError(t, signalPair(pcOffer, pcAnswer))

_, err = pcOffer.AddTransceiverFromKind(RTPCodecTypeVideo, RtpTransceiverInit{
_, err = pcOffer.AddTransceiverFromKind(RTPCodecTypeVideo, RTPTransceiverInit{
Direction: RTPTransceiverDirectionRecvonly,
})
assert.NoError(t, err)
assert.NoError(t, signalPair(pcOffer, pcAnswer))

_, err = pcAnswer.AddTransceiverFromKind(RTPCodecTypeVideo, RtpTransceiverInit{
_, err = pcAnswer.AddTransceiverFromKind(RTPCodecTypeVideo, RTPTransceiverInit{
Direction: RTPTransceiverDirectionSendonly,
})
assert.NoError(t, err)
Expand Down
4 changes: 0 additions & 4 deletions rtptransceiverinit.go
Original file line number Diff line number Diff line change
Expand Up @@ -9,7 +9,3 @@ type RTPTransceiverInit struct {
SendEncodings []RTPEncodingParameters
// Streams []*Track
}

// RtpTransceiverInit is a temporary mapping while we fix case sensitivity
// Deprecated: Use RTPTransceiverInit instead
type RtpTransceiverInit = RTPTransceiverInit //nolint: stylecheck,golint
11 changes: 0 additions & 11 deletions settingengine.go
Original file line number Diff line number Diff line change
Expand Up @@ -19,7 +19,6 @@ import (
"github.com/pion/logging"
"github.com/pion/transport/v3"
"github.com/pion/transport/v3/packetio"
"github.com/pion/transport/v3/vnet"
"golang.org/x/net/proxy"
)

Expand Down Expand Up @@ -254,16 +253,6 @@ func (e *SettingEngine) SetAnsweringDTLSRole(role DTLSRole) error {
return nil
}

// SetVNet sets the VNet instance that is passed to pion/ice
//
// VNet is a virtual network layer for Pion, allowing users to simulate
// different topologies, latency, loss and jitter. This can be useful for
// learning WebRTC concepts or testing your application in a lab environment
// Deprecated: Please use SetNet()
func (e *SettingEngine) SetVNet(vnet *vnet.Net) {
e.SetNet(vnet)
}

// SetNet sets the Net instance that is passed to pion/ice
//
// Net is an network interface layer for Pion, allowing users to replace
Expand Down
4 changes: 2 additions & 2 deletions vnet_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -33,7 +33,7 @@ func createVNetPair(t *testing.T) (*PeerConnection, *PeerConnection, *vnet.Route
assert.NoError(t, wan.AddNet(offerVNet))

offerSettingEngine := SettingEngine{}
offerSettingEngine.SetVNet(offerVNet)
offerSettingEngine.SetNet(offerVNet)
offerSettingEngine.SetICETimeouts(time.Second, time.Second, time.Millisecond*200)

// Create a network interface for answerer
Expand All @@ -46,7 +46,7 @@ func createVNetPair(t *testing.T) (*PeerConnection, *PeerConnection, *vnet.Route
assert.NoError(t, wan.AddNet(answerVNet))

answerSettingEngine := SettingEngine{}
answerSettingEngine.SetVNet(answerVNet)
answerSettingEngine.SetNet(answerVNet)
answerSettingEngine.SetICETimeouts(time.Second, time.Second, time.Millisecond*200)

// Start the virtual network by calling Start() on the root router
Expand Down

0 comments on commit 52b3fb0

Please sign in to comment.