Don't store transceiver MID

These are generated at runtime (depending if we are doing Plan-B or
Unified Plan). Currently this field is actually unused, so just getting
rid of it.

Relates to #106
This commit is contained in:
Sean DuBois
2019-07-21 21:18:30 -07:00
parent 584bd651c1
commit 775a521176
3 changed files with 2 additions and 9 deletions

View File

@@ -23,10 +23,6 @@ import (
"github.com/pion/webrtc/v2/pkg/rtcerr"
)
const (
newTransceiverMid = "NEW"
)
// 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.
@@ -579,7 +575,6 @@ func satisfyTypeAndDirection(remoteKind RTPCodecType, remoteDirection RTPTransce
}
return &RTPTransceiver{
Mid: newTransceiverMid,
kind: remoteKind,
Direction: RTPTransceiverDirectionInactive,
}, localTransceivers
@@ -642,7 +637,7 @@ func (pc *PeerConnection) addAnswerMediaTransceivers(d *sdp.SessionDescription)
for {
// keep going until we can't get any more
t, localTransceivers = satisfyTypeAndDirection(kind, direction, localTransceivers)
if t.Mid == newTransceiverMid {
if t.Direction == RTPTransceiverDirectionInactive {
break
}
mediaTransceivers = append(mediaTransceivers, t)
@@ -1338,7 +1333,6 @@ func (pc *PeerConnection) AddTrack(track *Track) (*RTPSender, error) {
)
}
transceiver.Mid = track.Kind().String() // TODO: Mid generation
return transceiver.Sender, nil
}

View File

@@ -374,7 +374,7 @@ func TestPeerConnection_AnswerWithoutOffer(t *testing.T) {
func TestPeerConnection_satisfyTypeAndDirection(t *testing.T) {
createTransceiver := func(kind RTPCodecType, direction RTPTransceiverDirection) *RTPTransceiver {
return &RTPTransceiver{Mid: newTransceiverMid, kind: kind, Direction: direction}
return &RTPTransceiver{kind: kind, Direction: direction}
}
for _, test := range []struct {

View File

@@ -8,7 +8,6 @@ import (
// RTPTransceiver represents a combination of an RTPSender and an RTPReceiver that share a common mid.
type RTPTransceiver struct {
Mid string
Sender *RTPSender
Receiver *RTPReceiver
Direction RTPTransceiverDirection