From 15dfc5a567e64405db573c0b7a959c9d9a786ecc Mon Sep 17 00:00:00 2001 From: Sergio Garcia Murillo Date: Tue, 11 Oct 2022 12:34:44 +0200 Subject: [PATCH] Add GetContributionSources to TransformableIncomingAudioFrame RTPHeader is not exported, so the TransformableIncomingAudioFrame can't be mocked in chrome tests, using a getter instead. Bug: chromium:1247260 Change-Id: I2af4e6a88b3f4772b3bb50ee0ae9d5c80fed3ae4 Reviewed-on: https://webrtc-review.googlesource.com/c/src/+/278785 Reviewed-by: Harald Alvestrand Commit-Queue: Tomas Gunnarsson Reviewed-by: Tomas Gunnarsson Cr-Commit-Position: refs/heads/main@{#38352} --- api/frame_transformer_interface.h | 2 ++ audio/channel_receive_frame_transformer_delegate.cc | 3 +++ 2 files changed, 5 insertions(+) diff --git a/api/frame_transformer_interface.h b/api/frame_transformer_interface.h index de2c612ac0..5efd3ea051 100644 --- a/api/frame_transformer_interface.h +++ b/api/frame_transformer_interface.h @@ -73,6 +73,8 @@ class TransformableAudioFrameInterface : public TransformableFrameInterface { // information in the header as needed, for example to compile the list of // csrcs. virtual const RTPHeader& GetHeader() const = 0; + + virtual rtc::ArrayView GetContributingSources() const = 0; }; // Objects implement this interface to be notified with the transformed frame. diff --git a/audio/channel_receive_frame_transformer_delegate.cc b/audio/channel_receive_frame_transformer_delegate.cc index 0f742e5b16..e8ba6ded47 100644 --- a/audio/channel_receive_frame_transformer_delegate.cc +++ b/audio/channel_receive_frame_transformer_delegate.cc @@ -37,6 +37,9 @@ class TransformableIncomingAudioFrame uint32_t GetSsrc() const override { return ssrc_; } uint32_t GetTimestamp() const override { return header_.timestamp; } const RTPHeader& GetHeader() const override { return header_; } + rtc::ArrayView GetContributingSources() const override { + return rtc::ArrayView(header_.arrOfCSRCs, header_.numCSRCs); + } Direction GetDirection() const override { return Direction::kReceiver; } private: