From 927244db7e18614fbf0a363a00083b9404d958bc Mon Sep 17 00:00:00 2001 From: Harald Alvestrand Date: Sat, 7 Sep 2024 16:04:14 +0000 Subject: [PATCH] Set MID in AudioReceiveChannel This variable was present but unset. Bug: webrtc:360058654 Change-Id: I492069a1e87208c6fbb5ad5f0a00fcc2ccc0bc25 Reviewed-on: https://webrtc-review.googlesource.com/c/src/+/361824 Commit-Queue: Harald Alvestrand Reviewed-by: Florent Castelli Cr-Commit-Position: refs/heads/main@{#42988} --- media/base/media_channel.h | 7 ++++--- media/engine/webrtc_voice_engine.cc | 1 + pc/channel.cc | 1 + 3 files changed, 6 insertions(+), 3 deletions(-) diff --git a/media/base/media_channel.h b/media/base/media_channel.h index c59a5753a6..b7f5987f6e 100644 --- a/media/base/media_channel.h +++ b/media/base/media_channel.h @@ -828,6 +828,10 @@ struct RtcpParameters { struct MediaChannelParameters { virtual ~MediaChannelParameters() = default; + // This is the value to be sent in the MID RTP header extension (if the header + // extension in included in the list of extensions). + // It is also used as a key to map the channnel to its transport. + std::string mid; std::vector codecs; std::vector extensions; @@ -862,9 +866,6 @@ struct MediaChannelParameters { struct SenderParameters : MediaChannelParameters { int max_bandwidth_bps = -1; - // This is the value to be sent in the MID RTP header extension (if the header - // extension in included in the list of extensions). - std::string mid; bool extmap_allow_mixed = false; protected: diff --git a/media/engine/webrtc_voice_engine.cc b/media/engine/webrtc_voice_engine.cc index 0232ad8d08..e65d0eb734 100644 --- a/media/engine/webrtc_voice_engine.cc +++ b/media/engine/webrtc_voice_engine.cc @@ -2071,6 +2071,7 @@ bool WebRtcVoiceReceiveChannel::SetReceiverParameters( << params.ToString(); // TODO(pthatcher): Refactor this to be more clean now that we have // all the information at once. + mid_ = params.mid; if (!SetRecvCodecs(params.codecs)) { return false; diff --git a/pc/channel.cc b/pc/channel.cc index af130f8316..45c6e74f64 100644 --- a/pc/channel.cc +++ b/pc/channel.cc @@ -878,6 +878,7 @@ bool VoiceChannel::SetLocalContent_w(const MediaContentDescription* content, content, header_extensions, webrtc::RtpTransceiverDirectionHasRecv(content->direction()), &recv_params); + recv_params.mid = mid(); if (!media_receive_channel()->SetReceiverParameters(recv_params)) { error_desc = StringFormat(