Fix apply frame transformer to MID demuxed audio streams

Manually tested with libwebrtc built for Android and a solution running into the same problem as the linked repro in chromium:1348132.

Bug: chromium:1348132
Change-Id: I88260b9ac72c67f1a6ad927e075d1490ac06ce91
Reviewed-on: https://webrtc-review.googlesource.com/c/src/+/278241
Commit-Queue: Harald Alvestrand <hta@webrtc.org>
Reviewed-by: Harald Alvestrand <hta@webrtc.org>
Cr-Commit-Position: refs/heads/main@{#38335}
This commit is contained in:
Lennart Grahl 2022-10-06 14:34:39 +02:00 committed by WebRTC LUCI CQ
parent 828ef91817
commit a5ba250c26
2 changed files with 10 additions and 1 deletions

View File

@ -1935,7 +1935,7 @@ bool WebRtcVoiceMediaChannel::AddRecvStream(const StreamParams& sp) {
codec_pair_id_, engine()->audio_jitter_buffer_max_packets_,
engine()->audio_jitter_buffer_fast_accelerate_,
engine()->audio_jitter_buffer_min_delay_ms_, unsignaled_frame_decryptor_,
crypto_options_, nullptr);
crypto_options_, unsignaled_frame_transformer_);
recv_streams_.insert(std::make_pair(
ssrc, new WebRtcAudioReceiveStream(std::move(config), call_)));
@ -2481,6 +2481,13 @@ void WebRtcVoiceMediaChannel::SetDepacketizerToDecoderFrameTransformer(
uint32_t ssrc,
rtc::scoped_refptr<webrtc::FrameTransformerInterface> frame_transformer) {
RTC_DCHECK_RUN_ON(worker_thread_);
if (ssrc == 0) {
// If the receiver is unsignaled, save the frame transformer and set it when
// the stream is associated with an ssrc.
unsignaled_frame_transformer_ = std::move(frame_transformer);
return;
}
auto matching_stream = recv_streams_.find(ssrc);
if (matching_stream == recv_streams_.end()) {
RTC_LOG(LS_INFO) << "Attempting to set frame transformer for SSRC:" << ssrc

View File

@ -321,6 +321,8 @@ class WebRtcVoiceMediaChannel final : public VoiceMediaChannel,
// Unsignaled streams have an option to have a frame decryptor set on them.
rtc::scoped_refptr<webrtc::FrameDecryptorInterface>
unsignaled_frame_decryptor_;
rtc::scoped_refptr<webrtc::FrameTransformerInterface>
unsignaled_frame_transformer_;
};
} // namespace cricket