mirror of
https://github.com/livekit/livekit.git
synced 2026-08-28 22:28:20 +00:00
limit to receive only
This commit is contained in:
@@ -179,6 +179,10 @@ func (p *ParticipantImpl) populateMid(parsedOffer *sdp.SessionDescription) {
|
||||
continue
|
||||
}
|
||||
|
||||
if p.TransportManager.GetPublisherRTPTransceiverDirection(mid) != webrtc.RTPTransceiverDirectionRecvonly {
|
||||
continue
|
||||
}
|
||||
|
||||
p.pendingTracksLock.Lock()
|
||||
signalCid, ti, migrated := p.getPendingTrackByTrackTypeWithoutMid(trackType)
|
||||
if migrated || ti == nil || signalCid == "" {
|
||||
|
||||
@@ -1160,6 +1160,16 @@ func (t *PCTransport) GetRTPReceiver(mid string) *webrtc.RTPReceiver {
|
||||
return nil
|
||||
}
|
||||
|
||||
func (t *PCTransport) GetRTPTransceiverDirection(mid string) webrtc.RTPTransceiverDirection {
|
||||
for _, tr := range t.pc.GetTransceivers() {
|
||||
if tr.Mid() == mid {
|
||||
return tr.Direction()
|
||||
}
|
||||
}
|
||||
|
||||
return webrtc.RTPTransceiverDirectionUnknown
|
||||
}
|
||||
|
||||
func (t *PCTransport) CreateDataChannel(label string, dci *webrtc.DataChannelInit) error {
|
||||
dc, err := t.pc.CreateDataChannel(label, dci)
|
||||
if err != nil {
|
||||
|
||||
@@ -248,6 +248,14 @@ func (t *TransportManager) GetPublisherRTPReceiver(mid string) *webrtc.RTPReceiv
|
||||
}
|
||||
}
|
||||
|
||||
func (t *TransportManager) GetPublisherRTPTransceiverDirection(mid string) webrtc.RTPTransceiverDirection {
|
||||
if t.params.SinglePeerConnection {
|
||||
return t.subscriber.GetRTPTransceiverDirection(mid)
|
||||
} else {
|
||||
return t.publisher.GetRTPTransceiverDirection(mid)
|
||||
}
|
||||
}
|
||||
|
||||
func (t *TransportManager) WritePublisherRTCP(pkts []rtcp.Packet) error {
|
||||
if t.params.SinglePeerConnection {
|
||||
return t.subscriber.WriteRTCP(pkts)
|
||||
|
||||
Reference in New Issue
Block a user