From b40f599c252fa7f9e75a2fe66072ee3df07ce71a Mon Sep 17 00:00:00 2001 From: do-hyung-kim Date: Wed, 26 Jul 2023 16:40:06 +0900 Subject: [PATCH] Add RTPReceiver.RTPTransceiver Returns the RTPTransceiver currently associated with this RTPReceiver --- rtpreceiver.go | 9 +++++++++ 1 file changed, 9 insertions(+) diff --git a/rtpreceiver.go b/rtpreceiver.go index dac154be6d6..c04a715f5ba 100644 --- a/rtpreceiver.go +++ b/rtpreceiver.go @@ -126,6 +126,15 @@ func (r *RTPReceiver) Tracks() []*TrackRemote { return tracks } +// RTPTransceiver returns the RTPTransceiver this +// RTPReceiver belongs too, or nil if none +func (r *RTPReceiver) RTPTransceiver() *RTPTransceiver { + r.mu.Lock() + defer r.mu.Unlock() + + return r.tr +} + // configureReceive initialize the track func (r *RTPReceiver) configureReceive(parameters RTPReceiveParameters) { r.mu.Lock()