mirror of
https://github.com/pion/webrtc.git
synced 2025-12-24 11:51:03 +08:00
Revert "Add currentDirection to RTPTransceiver"
This reverts commit 045df4c4bf.
This commit is contained in:
@@ -13,11 +13,10 @@ import (
|
||||
|
||||
// RTPTransceiver represents a combination of an RTPSender and an RTPReceiver that share a common mid.
|
||||
type RTPTransceiver struct {
|
||||
mid atomic.Value // string
|
||||
sender atomic.Value // *RTPSender
|
||||
receiver atomic.Value // *RTPReceiver
|
||||
direction atomic.Value // RTPTransceiverDirection
|
||||
currentDirection atomic.Value // RTPTransceiverDirection
|
||||
mid atomic.Value // string
|
||||
sender atomic.Value // *RTPSender
|
||||
receiver atomic.Value // *RTPReceiver
|
||||
direction atomic.Value // RTPTransceiverDirection
|
||||
|
||||
codecs []RTPCodecParameters // User provided codecs via SetCodecPreferences
|
||||
|
||||
@@ -39,7 +38,6 @@ func newRTPTransceiver(
|
||||
t.setReceiver(receiver)
|
||||
t.setSender(sender)
|
||||
t.setDirection(direction)
|
||||
t.setCurrentDirection(RTPTransceiverDirection(Unknown))
|
||||
return t
|
||||
}
|
||||
|
||||
@@ -162,7 +160,6 @@ func (t *RTPTransceiver) Stop() error {
|
||||
}
|
||||
|
||||
t.setDirection(RTPTransceiverDirectionInactive)
|
||||
t.setCurrentDirection(RTPTransceiverDirectionInactive)
|
||||
return nil
|
||||
}
|
||||
|
||||
@@ -182,17 +179,6 @@ func (t *RTPTransceiver) setDirection(d RTPTransceiverDirection) {
|
||||
t.direction.Store(d)
|
||||
}
|
||||
|
||||
func (t *RTPTransceiver) setCurrentDirection(d RTPTransceiverDirection) {
|
||||
t.currentDirection.Store(d)
|
||||
}
|
||||
|
||||
func (t *RTPTransceiver) getCurrentDirection() RTPTransceiverDirection {
|
||||
if v, ok := t.currentDirection.Load().(RTPTransceiverDirection); ok {
|
||||
return v
|
||||
}
|
||||
return RTPTransceiverDirection(Unknown)
|
||||
}
|
||||
|
||||
func (t *RTPTransceiver) setSendingTrack(track TrackLocal) error {
|
||||
if err := t.Sender().ReplaceTrack(track); err != nil {
|
||||
return err
|
||||
|
||||
Reference in New Issue
Block a user