mirror of
https://github.com/pion/webrtc.git
synced 2025-12-24 11:51:03 +08:00
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:
@@ -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
|
||||
}
|
||||
|
||||
|
||||
@@ -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 {
|
||||
|
||||
@@ -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
|
||||
|
||||
Reference in New Issue
Block a user