From 510449937325fda42ac0f7eaa2435b00370f0655 Mon Sep 17 00:00:00 2001 From: OrlandoCo Date: Tue, 3 Nov 2020 14:13:28 -0600 Subject: [PATCH] Add RTPTransceiver.SetSender This non-standard API allows us to re-use existing transceivers. The WebRTC API causes SDP bloat right now since it doesn't allow the re-use of existing media sections. --- rtptransceiver.go | 6 ++++++ 1 file changed, 6 insertions(+) diff --git a/rtptransceiver.go b/rtptransceiver.go index 706ed765d84..40da8d334af 100644 --- a/rtptransceiver.go +++ b/rtptransceiver.go @@ -30,6 +30,12 @@ func (t *RTPTransceiver) Sender() *RTPSender { return nil } +// SetSender sets the RTPSender and Track to current transceiver +func (t *RTPTransceiver) SetSender(s *RTPSender, track *Track) error { + t.setSender(s) + return t.setSendingTrack(track) +} + func (t *RTPTransceiver) setSender(s *RTPSender) { t.sender.Store(s) }