webrtc_m130/audio/audio_receive_stream.h

Ignoring revisions in .git-blame-ignore-revs. Click here to bypass and see the normal blame view.

173 lines
6.6 KiB
C
Raw Normal View History

/*
* Copyright (c) 2015 The WebRTC project authors. All Rights Reserved.
*
* Use of this source code is governed by a BSD-style license
* that can be found in the LICENSE file in the root of the source
* tree. An additional intellectual property rights grant can be found
* in the file PATENTS. All contributing project authors may
* be found in the AUTHORS file in the root of the source tree.
*/
#ifndef AUDIO_AUDIO_RECEIVE_STREAM_H_
#define AUDIO_AUDIO_RECEIVE_STREAM_H_
Reland "Remove AudioReceiveStream::Reconfigure() method." This reverts commit 8a18e5b3c954a3f9cc006c90356a3d850bcc352f. Reason for revert: Removing the problematic DCHECK. Original change's description: > Revert "Remove AudioReceiveStream::Reconfigure() method." > > This reverts commit e2561e17e29e62c02731f1d214d7ee5ffdaeb941. > > Reason for revert: Speculative revert: breaks an downstream project > > Original change's description: > > Remove AudioReceiveStream::Reconfigure() method. > > > > Instead, adding specific setters that are needed at runtime: > > * SetDepacketizerToDecoderFrameTransformer > > * SetDecoderMap > > * SetUseTransportCcAndNackHistory > > > > The whole config struct is big and much of the state it holds, needs to > > be considered const. For that reason the Reconfigure() method is too > > broad of an interface since it overwrites the whole config struct > > and doesn't actually handle all the potential config changes that might > > occur when the config changes. > > > > Bug: webrtc:11993 > > Change-Id: Ia5311978f56b2e136781467e44f0d18039f0bb2d > > Reviewed-on: https://webrtc-review.googlesource.com/c/src/+/221363 > > Reviewed-by: Niels Moller <nisse@webrtc.org> > > Commit-Queue: Tommi <tommi@webrtc.org> > > Cr-Commit-Position: refs/heads/master@{#34252} > > TBR=saza@webrtc.org,nisse@webrtc.org,tommi@webrtc.org,webrtc-scoped@luci-project-accounts.iam.gserviceaccount.com > > Change-Id: I15ca2d8ee5fd612e13dc1f4b3bfb9c885c21dc66 > No-Presubmit: true > No-Tree-Checks: true > No-Try: true > Bug: webrtc:11993 > Reviewed-on: https://webrtc-review.googlesource.com/c/src/+/221746 > Commit-Queue: Artem Titov <titovartem@webrtc.org> > Reviewed-by: Andrey Logvin <landrey@webrtc.org> > Cr-Commit-Position: refs/heads/master@{#34253} # Not skipping CQ checks because this is a reland. Bug: webrtc:11993 Change-Id: I0d3bf9abdcdc8d3f9259d014e6074a5e6b6cc73c Reviewed-on: https://webrtc-review.googlesource.com/c/src/+/221747 Reviewed-by: Tommi <tommi@webrtc.org> Reviewed-by: Artem Titov <titovartem@webrtc.org> Reviewed-by: Andrey Logvin <landrey@webrtc.org> Commit-Queue: Tommi <tommi@webrtc.org> Cr-Commit-Position: refs/heads/master@{#34255}
2021-06-09 13:46:28 +02:00
#include <map>
#include <memory>
#include <string>
Reland of Implemented the GetSources() in native code. (patchset #1 id:1 of https://codereview.webrtc.org/2809613002/ ) Reason for revert: Re-land, reverting did not fix bug. https://bugs.chromium.org/p/webrtc/issues/detail?id=7465 Original issue's description: > Revert of Implemented the GetSources() in native code. (patchset #11 id:510001 of https://codereview.webrtc.org/2770233003/ ) > > Reason for revert: > Suspected of WebRtcApprtcBrowserTest.MANUAL_WorksOnApprtc breakage, see > > https://bugs.chromium.org/p/webrtc/issues/detail?id=7465 > > Original issue's description: > > Added the GetSources() to the RtpReceiverInterface and implemented > > it for the AudioRtpReceiver. > > > > This method returns a vector of RtpSource(both CSRC source and SSRC > > source) which contains the ID of a source, the timestamp, the source > > type (SSRC or CSRC) and the audio level. > > > > The RtpSource objects are buffered and maintained by the > > RtpReceiver in webrtc/modules/rtp_rtcp/. When the method is called, > > the info of the contributing source will be pulled along the object > > chain: > > AudioRtpReceiver -> VoiceChannel -> WebRtcVoiceMediaChannel -> > > AudioReceiveStream -> voe::Channel -> RtpRtcp module > > > > Spec:https://w3c.github.io/webrtc-pc/archives/20151006/webrtc.html#widl-RTCRtpReceiver-getContributingSources-sequence-RTCRtpContributingSource > > > > BUG=chromium:703122 > > TBR=stefan@webrtc.org, danilchap@webrtc.org > > > > Review-Url: https://codereview.webrtc.org/2770233003 > > Cr-Commit-Position: refs/heads/master@{#17591} > > Committed: https://chromium.googlesource.com/external/webrtc/+/292084c3765d9f3ee406ca2ec86eae206b540053 > > TBR=deadbeef@webrtc.org,solenberg@webrtc.org,hbos@webrtc.org,philipel@webrtc.org,stefan@webrtc.org,danilchap@webrtc.org,zhihuang@webrtc.org > # Not skipping CQ checks because original CL landed more than 1 days ago. > BUG=chromium:703122 > > Review-Url: https://codereview.webrtc.org/2809613002 > Cr-Commit-Position: refs/heads/master@{#17616} > Committed: https://chromium.googlesource.com/external/webrtc/+/fbcc5cb3869d1370008e40f24fc03ac8fb69c675 TBR=deadbeef@webrtc.org,solenberg@webrtc.org,philipel@webrtc.org,stefan@webrtc.org,danilchap@webrtc.org,zhihuang@webrtc.org,olka@webrtc.org # Skipping CQ checks because original CL landed less than 1 days ago. NOPRESUBMIT=true NOTREECHECKS=true NOTRY=true BUG=chromium:703122 Review-Url: https://codereview.webrtc.org/2810623003 Cr-Commit-Position: refs/heads/master@{#17621}
2017-04-10 07:39:05 -07:00
#include <vector>
#include "absl/strings/string_view.h"
#include "api/audio/audio_mixer.h"
#include "api/neteq/neteq_factory.h"
#include "api/rtp_headers.h"
#include "api/sequence_checker.h"
#include "audio/audio_state.h"
#include "call/audio_receive_stream.h"
#include "call/syncable.h"
Reland "Replace the implementation of `GetContributingSources()` on the audio side." This reverts commit 67008dfb366237469fe088a61b62c0cad852c024. Reason for revert: Tests in the Chromium repo have been changed to accomodate this CL: https://chromium-review.googlesource.com/c/chromium/src/+/1728565 Original change's description: > Revert "Replace the implementation of `GetContributingSources()` on the audio side." > > This reverts commit 8fa7151e4bbad40fec1f964fe0c003b8787bb78a. > > Reason for revert: Speculative revert to fix roll of webrtc into chrome. Right now tests related to RTCRtpReceiver failing and looks like it is main candidate, who can affect that behavior. > > Original change's description: > > Replace the implementation of `GetContributingSources()` on the audio side. > > > > This change replaces the `ContributingSources`-implementation of `GetContributingSources()` and `GetSynchronizationSources()` on the audio side with the spec-compliant `SourceTracker`-implementation. > > > > The most noticeable impact is that the per-frame dictionaries are now updated when frames are delivered to the RTCRtpReceiver's MediaStreamTrack rather than when RTP packets are received on the network. > > > > This change is almost identical to the previous video side change at: https://webrtc-review.googlesource.com/c/src/+/143177 > > > > Bug: webrtc:10545 > > Change-Id: Ife7f08ee8ca1346099b7466837a3756947085fc5 > > Reviewed-on: https://webrtc-review.googlesource.com/c/src/+/144422 > > Reviewed-by: Oskar Sundbom <ossu@webrtc.org> > > Commit-Queue: Chen Xing <chxg@google.com> > > Cr-Commit-Position: refs/heads/master@{#28459} > > TBR=ossu@webrtc.org,chxg@google.com > > Change-Id: I5c631d4dcfb39601055ffce9b104f45eea871fd3 > No-Presubmit: true > No-Tree-Checks: true > No-Try: true > Bug: webrtc:10545 > Reviewed-on: https://webrtc-review.googlesource.com/c/src/+/144562 > Reviewed-by: Artem Titov <titovartem@webrtc.org> > Commit-Queue: Artem Titov <titovartem@webrtc.org> > Cr-Commit-Position: refs/heads/master@{#28478} TBR=ossu@webrtc.org,titovartem@webrtc.org,chxg@google.com # Not skipping CQ checks because original CL landed > 1 day ago. Bug: webrtc:10545 Change-Id: I609cca4f0ca4e1d31a156ba9eb44407518409f57 Reviewed-on: https://webrtc-review.googlesource.com/c/src/+/147865 Reviewed-by: Henrik Boström <hbos@webrtc.org> Reviewed-by: Chen Xing <chxg@google.com> Commit-Queue: Chen Xing <chxg@google.com> Cr-Commit-Position: refs/heads/master@{#28746}
2019-08-02 10:29:26 +00:00
#include "modules/rtp_rtcp/source/source_tracker.h"
#include "rtc_base/system/no_unique_address.h"
#include "system_wrappers/include/clock.h"
namespace webrtc {
class PacketRouter;
class RtcEventLog;
class RtpStreamReceiverControllerInterface;
class RtpStreamReceiverInterface;
namespace voe {
class ChannelReceiveInterface;
} // namespace voe
namespace internal {
class AudioSendStream;
} // namespace internal
class AudioReceiveStreamImpl final : public webrtc::AudioReceiveStreamInterface,
public AudioMixer::Source,
public Syncable {
public:
AudioReceiveStreamImpl(
Clock* clock,
PacketRouter* packet_router,
NetEqFactory* neteq_factory,
const webrtc::AudioReceiveStreamInterface::Config& config,
const rtc::scoped_refptr<webrtc::AudioState>& audio_state,
webrtc::RtcEventLog* event_log);
// For unit tests, which need to supply a mock channel receive.
AudioReceiveStreamImpl(
Clock* clock,
PacketRouter* packet_router,
const webrtc::AudioReceiveStreamInterface::Config& config,
const rtc::scoped_refptr<webrtc::AudioState>& audio_state,
webrtc::RtcEventLog* event_log,
std::unique_ptr<voe::ChannelReceiveInterface> channel_receive);
AudioReceiveStreamImpl() = delete;
AudioReceiveStreamImpl(const AudioReceiveStreamImpl&) = delete;
AudioReceiveStreamImpl& operator=(const AudioReceiveStreamImpl&) = delete;
// Destruction happens on the worker thread. Prior to destruction the caller
// must ensure that a registration with the transport has been cleared. See
// `RegisterWithTransport` for details.
// TODO(tommi): As a further improvement to this, performing the full
// destruction on the network thread could be made the default.
~AudioReceiveStreamImpl() override;
// Called on the network thread to register/unregister with the network
// transport.
void RegisterWithTransport(
RtpStreamReceiverControllerInterface* receiver_controller);
// If registration has previously been done (via `RegisterWithTransport`) then
// `UnregisterFromTransport` must be called prior to destruction, on the
// network thread.
void UnregisterFromTransport();
// webrtc::AudioReceiveStreamInterface implementation.
void Start() override;
void Stop() override;
bool IsRunning() const override;
Reland "Remove AudioReceiveStream::Reconfigure() method." This reverts commit 8a18e5b3c954a3f9cc006c90356a3d850bcc352f. Reason for revert: Removing the problematic DCHECK. Original change's description: > Revert "Remove AudioReceiveStream::Reconfigure() method." > > This reverts commit e2561e17e29e62c02731f1d214d7ee5ffdaeb941. > > Reason for revert: Speculative revert: breaks an downstream project > > Original change's description: > > Remove AudioReceiveStream::Reconfigure() method. > > > > Instead, adding specific setters that are needed at runtime: > > * SetDepacketizerToDecoderFrameTransformer > > * SetDecoderMap > > * SetUseTransportCcAndNackHistory > > > > The whole config struct is big and much of the state it holds, needs to > > be considered const. For that reason the Reconfigure() method is too > > broad of an interface since it overwrites the whole config struct > > and doesn't actually handle all the potential config changes that might > > occur when the config changes. > > > > Bug: webrtc:11993 > > Change-Id: Ia5311978f56b2e136781467e44f0d18039f0bb2d > > Reviewed-on: https://webrtc-review.googlesource.com/c/src/+/221363 > > Reviewed-by: Niels Moller <nisse@webrtc.org> > > Commit-Queue: Tommi <tommi@webrtc.org> > > Cr-Commit-Position: refs/heads/master@{#34252} > > TBR=saza@webrtc.org,nisse@webrtc.org,tommi@webrtc.org,webrtc-scoped@luci-project-accounts.iam.gserviceaccount.com > > Change-Id: I15ca2d8ee5fd612e13dc1f4b3bfb9c885c21dc66 > No-Presubmit: true > No-Tree-Checks: true > No-Try: true > Bug: webrtc:11993 > Reviewed-on: https://webrtc-review.googlesource.com/c/src/+/221746 > Commit-Queue: Artem Titov <titovartem@webrtc.org> > Reviewed-by: Andrey Logvin <landrey@webrtc.org> > Cr-Commit-Position: refs/heads/master@{#34253} # Not skipping CQ checks because this is a reland. Bug: webrtc:11993 Change-Id: I0d3bf9abdcdc8d3f9259d014e6074a5e6b6cc73c Reviewed-on: https://webrtc-review.googlesource.com/c/src/+/221747 Reviewed-by: Tommi <tommi@webrtc.org> Reviewed-by: Artem Titov <titovartem@webrtc.org> Reviewed-by: Andrey Logvin <landrey@webrtc.org> Commit-Queue: Tommi <tommi@webrtc.org> Cr-Commit-Position: refs/heads/master@{#34255}
2021-06-09 13:46:28 +02:00
void SetDepacketizerToDecoderFrameTransformer(
rtc::scoped_refptr<webrtc::FrameTransformerInterface> frame_transformer)
override;
void SetDecoderMap(std::map<int, SdpAudioFormat> decoder_map) override;
void SetNackHistory(int history_ms) override;
Reland "Wire up non-sender RTT for audio, and implement related standardized stats." This reverts commit 2c41cbae37cac548a1133589b9d2c2e8614fa6cb. Reason for revert: The breaking test in Chromium has been temporarily disabled in https://chromium-review.googlesource.com/c/chromium/src/+/3139794/2. Original change's description: > Revert "Wire up non-sender RTT for audio, and implement related standardized stats." > > This reverts commit fb0dca6c055cbf9e43af665d3c437eba6f43372e. > > Reason for revert: Speculative revert due to failing stats test in chromium. Possibly because the chromium test expected the metrics to not be supported, and now they are. Reverting just to unblock the webrtc roll into chromium. > > Original change's description: > > Wire up non-sender RTT for audio, and implement related standardized stats. > > > > The implemented stats are: > > - https://www.w3.org/TR/webrtc-stats/#dom-rtcremoteoutboundrtpstreamstats-roundtriptime > > - https://www.w3.org/TR/webrtc-stats/#dom-rtcremoteoutboundrtpstreamstats-totalroundtriptime > > - https://www.w3.org/TR/webrtc-stats/#dom-rtcremoteoutboundrtpstreamstats-roundtriptimemeasurements > > > > Bug: webrtc:12951, webrtc:12714 > > Change-Id: Ia362d5c4b0456140e32da79d40edc06ab9ce2a2c > > Reviewed-on: https://webrtc-review.googlesource.com/c/src/+/226956 > > Commit-Queue: Ivo Creusen <ivoc@webrtc.org> > > Reviewed-by: Henrik Boström <hbos@webrtc.org> > > Reviewed-by: Harald Alvestrand <hta@webrtc.org> > > Reviewed-by: Danil Chapovalov <danilchap@webrtc.org> > > Cr-Commit-Position: refs/heads/main@{#34861} > > # Not skipping CQ checks because original CL landed > 1 day ago. > > TBR=hta,hbos,minyue > > Bug: webrtc:12951, webrtc:12714 > Change-Id: If07ad63286eea9cdde88271e61cc28f4b268b290 > Reviewed-on: https://webrtc-review.googlesource.com/c/src/+/231001 > Reviewed-by: Danil Chapovalov <danilchap@webrtc.org> > Reviewed-by: Ivo Creusen <ivoc@webrtc.org> > Reviewed-by: Olga Sharonova <olka@webrtc.org> > Commit-Queue: Björn Terelius <terelius@webrtc.org> > Cr-Commit-Position: refs/heads/main@{#34897} # Not skipping CQ checks because original CL landed > 1 day ago. Bug: webrtc:12951, webrtc:12714 Change-Id: I786b06933d85bdffc5e879bf52436bb3469b7f3a Reviewed-on: https://webrtc-review.googlesource.com/c/src/+/231181 Reviewed-by: Henrik Boström <hbos@webrtc.org> Reviewed-by: Björn Terelius <terelius@webrtc.org> Reviewed-by: Harald Alvestrand <hta@webrtc.org> Commit-Queue: Ivo Creusen <ivoc@webrtc.org> Cr-Commit-Position: refs/heads/main@{#34930}
2021-09-03 14:51:22 +00:00
void SetNonSenderRttMeasurement(bool enabled) override;
void SetFrameDecryptor(rtc::scoped_refptr<webrtc::FrameDecryptorInterface>
frame_decryptor) override;
webrtc::AudioReceiveStreamInterface::Stats GetStats(
bool get_and_clear_legacy_stats) const override;
void SetSink(AudioSinkInterface* sink) override;
void SetGain(float gain) override;
bool SetBaseMinimumPlayoutDelayMs(int delay_ms) override;
int GetBaseMinimumPlayoutDelayMs() const override;
Reland of Implemented the GetSources() in native code. (patchset #1 id:1 of https://codereview.webrtc.org/2809613002/ ) Reason for revert: Re-land, reverting did not fix bug. https://bugs.chromium.org/p/webrtc/issues/detail?id=7465 Original issue's description: > Revert of Implemented the GetSources() in native code. (patchset #11 id:510001 of https://codereview.webrtc.org/2770233003/ ) > > Reason for revert: > Suspected of WebRtcApprtcBrowserTest.MANUAL_WorksOnApprtc breakage, see > > https://bugs.chromium.org/p/webrtc/issues/detail?id=7465 > > Original issue's description: > > Added the GetSources() to the RtpReceiverInterface and implemented > > it for the AudioRtpReceiver. > > > > This method returns a vector of RtpSource(both CSRC source and SSRC > > source) which contains the ID of a source, the timestamp, the source > > type (SSRC or CSRC) and the audio level. > > > > The RtpSource objects are buffered and maintained by the > > RtpReceiver in webrtc/modules/rtp_rtcp/. When the method is called, > > the info of the contributing source will be pulled along the object > > chain: > > AudioRtpReceiver -> VoiceChannel -> WebRtcVoiceMediaChannel -> > > AudioReceiveStream -> voe::Channel -> RtpRtcp module > > > > Spec:https://w3c.github.io/webrtc-pc/archives/20151006/webrtc.html#widl-RTCRtpReceiver-getContributingSources-sequence-RTCRtpContributingSource > > > > BUG=chromium:703122 > > TBR=stefan@webrtc.org, danilchap@webrtc.org > > > > Review-Url: https://codereview.webrtc.org/2770233003 > > Cr-Commit-Position: refs/heads/master@{#17591} > > Committed: https://chromium.googlesource.com/external/webrtc/+/292084c3765d9f3ee406ca2ec86eae206b540053 > > TBR=deadbeef@webrtc.org,solenberg@webrtc.org,hbos@webrtc.org,philipel@webrtc.org,stefan@webrtc.org,danilchap@webrtc.org,zhihuang@webrtc.org > # Not skipping CQ checks because original CL landed more than 1 days ago. > BUG=chromium:703122 > > Review-Url: https://codereview.webrtc.org/2809613002 > Cr-Commit-Position: refs/heads/master@{#17616} > Committed: https://chromium.googlesource.com/external/webrtc/+/fbcc5cb3869d1370008e40f24fc03ac8fb69c675 TBR=deadbeef@webrtc.org,solenberg@webrtc.org,philipel@webrtc.org,stefan@webrtc.org,danilchap@webrtc.org,zhihuang@webrtc.org,olka@webrtc.org # Skipping CQ checks because original CL landed less than 1 days ago. NOPRESUBMIT=true NOTREECHECKS=true NOTRY=true BUG=chromium:703122 Review-Url: https://codereview.webrtc.org/2810623003 Cr-Commit-Position: refs/heads/master@{#17621}
2017-04-10 07:39:05 -07:00
std::vector<webrtc::RtpSource> GetSources() const override;
// AudioMixer::Source
AudioFrameInfo GetAudioFrameWithInfo(int sample_rate_hz,
AudioFrame* audio_frame) override;
int Ssrc() const override;
int PreferredSampleRate() const override;
// Syncable
uint32_t id() const override;
absl::optional<Syncable::Info> GetInfo() const override;
bool GetPlayoutRtpTimestamp(uint32_t* rtp_timestamp,
int64_t* time_ms) const override;
void SetEstimatedPlayoutNtpTimestampMs(int64_t ntp_timestamp_ms,
int64_t time_ms) override;
bool SetMinimumPlayoutDelay(int delay_ms) override;
void AssociateSendStream(internal::AudioSendStream* send_stream);
void DeliverRtcp(const uint8_t* packet, size_t length);
Reland "Remove AudioReceiveStream::Reconfigure() method." This reverts commit 8a18e5b3c954a3f9cc006c90356a3d850bcc352f. Reason for revert: Removing the problematic DCHECK. Original change's description: > Revert "Remove AudioReceiveStream::Reconfigure() method." > > This reverts commit e2561e17e29e62c02731f1d214d7ee5ffdaeb941. > > Reason for revert: Speculative revert: breaks an downstream project > > Original change's description: > > Remove AudioReceiveStream::Reconfigure() method. > > > > Instead, adding specific setters that are needed at runtime: > > * SetDepacketizerToDecoderFrameTransformer > > * SetDecoderMap > > * SetUseTransportCcAndNackHistory > > > > The whole config struct is big and much of the state it holds, needs to > > be considered const. For that reason the Reconfigure() method is too > > broad of an interface since it overwrites the whole config struct > > and doesn't actually handle all the potential config changes that might > > occur when the config changes. > > > > Bug: webrtc:11993 > > Change-Id: Ia5311978f56b2e136781467e44f0d18039f0bb2d > > Reviewed-on: https://webrtc-review.googlesource.com/c/src/+/221363 > > Reviewed-by: Niels Moller <nisse@webrtc.org> > > Commit-Queue: Tommi <tommi@webrtc.org> > > Cr-Commit-Position: refs/heads/master@{#34252} > > TBR=saza@webrtc.org,nisse@webrtc.org,tommi@webrtc.org,webrtc-scoped@luci-project-accounts.iam.gserviceaccount.com > > Change-Id: I15ca2d8ee5fd612e13dc1f4b3bfb9c885c21dc66 > No-Presubmit: true > No-Tree-Checks: true > No-Try: true > Bug: webrtc:11993 > Reviewed-on: https://webrtc-review.googlesource.com/c/src/+/221746 > Commit-Queue: Artem Titov <titovartem@webrtc.org> > Reviewed-by: Andrey Logvin <landrey@webrtc.org> > Cr-Commit-Position: refs/heads/master@{#34253} # Not skipping CQ checks because this is a reland. Bug: webrtc:11993 Change-Id: I0d3bf9abdcdc8d3f9259d014e6074a5e6b6cc73c Reviewed-on: https://webrtc-review.googlesource.com/c/src/+/221747 Reviewed-by: Tommi <tommi@webrtc.org> Reviewed-by: Artem Titov <titovartem@webrtc.org> Reviewed-by: Andrey Logvin <landrey@webrtc.org> Commit-Queue: Tommi <tommi@webrtc.org> Cr-Commit-Position: refs/heads/master@{#34255}
2021-06-09 13:46:28 +02:00
void SetSyncGroup(absl::string_view sync_group);
void SetLocalSsrc(uint32_t local_ssrc);
uint32_t local_ssrc() const;
Reland "Remove AudioReceiveStream::Reconfigure() method." This reverts commit 8a18e5b3c954a3f9cc006c90356a3d850bcc352f. Reason for revert: Removing the problematic DCHECK. Original change's description: > Revert "Remove AudioReceiveStream::Reconfigure() method." > > This reverts commit e2561e17e29e62c02731f1d214d7ee5ffdaeb941. > > Reason for revert: Speculative revert: breaks an downstream project > > Original change's description: > > Remove AudioReceiveStream::Reconfigure() method. > > > > Instead, adding specific setters that are needed at runtime: > > * SetDepacketizerToDecoderFrameTransformer > > * SetDecoderMap > > * SetUseTransportCcAndNackHistory > > > > The whole config struct is big and much of the state it holds, needs to > > be considered const. For that reason the Reconfigure() method is too > > broad of an interface since it overwrites the whole config struct > > and doesn't actually handle all the potential config changes that might > > occur when the config changes. > > > > Bug: webrtc:11993 > > Change-Id: Ia5311978f56b2e136781467e44f0d18039f0bb2d > > Reviewed-on: https://webrtc-review.googlesource.com/c/src/+/221363 > > Reviewed-by: Niels Moller <nisse@webrtc.org> > > Commit-Queue: Tommi <tommi@webrtc.org> > > Cr-Commit-Position: refs/heads/master@{#34252} > > TBR=saza@webrtc.org,nisse@webrtc.org,tommi@webrtc.org,webrtc-scoped@luci-project-accounts.iam.gserviceaccount.com > > Change-Id: I15ca2d8ee5fd612e13dc1f4b3bfb9c885c21dc66 > No-Presubmit: true > No-Tree-Checks: true > No-Try: true > Bug: webrtc:11993 > Reviewed-on: https://webrtc-review.googlesource.com/c/src/+/221746 > Commit-Queue: Artem Titov <titovartem@webrtc.org> > Reviewed-by: Andrey Logvin <landrey@webrtc.org> > Cr-Commit-Position: refs/heads/master@{#34253} # Not skipping CQ checks because this is a reland. Bug: webrtc:11993 Change-Id: I0d3bf9abdcdc8d3f9259d014e6074a5e6b6cc73c Reviewed-on: https://webrtc-review.googlesource.com/c/src/+/221747 Reviewed-by: Tommi <tommi@webrtc.org> Reviewed-by: Artem Titov <titovartem@webrtc.org> Reviewed-by: Andrey Logvin <landrey@webrtc.org> Commit-Queue: Tommi <tommi@webrtc.org> Cr-Commit-Position: refs/heads/master@{#34255}
2021-06-09 13:46:28 +02:00
uint32_t remote_ssrc() const override {
Reland "Remove AudioReceiveStream::Reconfigure() method." This reverts commit 8a18e5b3c954a3f9cc006c90356a3d850bcc352f. Reason for revert: Removing the problematic DCHECK. Original change's description: > Revert "Remove AudioReceiveStream::Reconfigure() method." > > This reverts commit e2561e17e29e62c02731f1d214d7ee5ffdaeb941. > > Reason for revert: Speculative revert: breaks an downstream project > > Original change's description: > > Remove AudioReceiveStream::Reconfigure() method. > > > > Instead, adding specific setters that are needed at runtime: > > * SetDepacketizerToDecoderFrameTransformer > > * SetDecoderMap > > * SetUseTransportCcAndNackHistory > > > > The whole config struct is big and much of the state it holds, needs to > > be considered const. For that reason the Reconfigure() method is too > > broad of an interface since it overwrites the whole config struct > > and doesn't actually handle all the potential config changes that might > > occur when the config changes. > > > > Bug: webrtc:11993 > > Change-Id: Ia5311978f56b2e136781467e44f0d18039f0bb2d > > Reviewed-on: https://webrtc-review.googlesource.com/c/src/+/221363 > > Reviewed-by: Niels Moller <nisse@webrtc.org> > > Commit-Queue: Tommi <tommi@webrtc.org> > > Cr-Commit-Position: refs/heads/master@{#34252} > > TBR=saza@webrtc.org,nisse@webrtc.org,tommi@webrtc.org,webrtc-scoped@luci-project-accounts.iam.gserviceaccount.com > > Change-Id: I15ca2d8ee5fd612e13dc1f4b3bfb9c885c21dc66 > No-Presubmit: true > No-Tree-Checks: true > No-Try: true > Bug: webrtc:11993 > Reviewed-on: https://webrtc-review.googlesource.com/c/src/+/221746 > Commit-Queue: Artem Titov <titovartem@webrtc.org> > Reviewed-by: Andrey Logvin <landrey@webrtc.org> > Cr-Commit-Position: refs/heads/master@{#34253} # Not skipping CQ checks because this is a reland. Bug: webrtc:11993 Change-Id: I0d3bf9abdcdc8d3f9259d014e6074a5e6b6cc73c Reviewed-on: https://webrtc-review.googlesource.com/c/src/+/221747 Reviewed-by: Tommi <tommi@webrtc.org> Reviewed-by: Artem Titov <titovartem@webrtc.org> Reviewed-by: Andrey Logvin <landrey@webrtc.org> Commit-Queue: Tommi <tommi@webrtc.org> Cr-Commit-Position: refs/heads/master@{#34255}
2021-06-09 13:46:28 +02:00
// The remote_ssrc member variable of config_ will never change and can be
// considered const.
return config_.rtp.remote_ssrc;
}
// Returns a reference to the currently set sync group of the stream.
// Must be called on the packet delivery thread.
const std::string& sync_group() const;
const AudioSendStream* GetAssociatedSendStreamForTesting() const;
Reland "Remove AudioReceiveStream::Reconfigure() method." This reverts commit 8a18e5b3c954a3f9cc006c90356a3d850bcc352f. Reason for revert: Removing the problematic DCHECK. Original change's description: > Revert "Remove AudioReceiveStream::Reconfigure() method." > > This reverts commit e2561e17e29e62c02731f1d214d7ee5ffdaeb941. > > Reason for revert: Speculative revert: breaks an downstream project > > Original change's description: > > Remove AudioReceiveStream::Reconfigure() method. > > > > Instead, adding specific setters that are needed at runtime: > > * SetDepacketizerToDecoderFrameTransformer > > * SetDecoderMap > > * SetUseTransportCcAndNackHistory > > > > The whole config struct is big and much of the state it holds, needs to > > be considered const. For that reason the Reconfigure() method is too > > broad of an interface since it overwrites the whole config struct > > and doesn't actually handle all the potential config changes that might > > occur when the config changes. > > > > Bug: webrtc:11993 > > Change-Id: Ia5311978f56b2e136781467e44f0d18039f0bb2d > > Reviewed-on: https://webrtc-review.googlesource.com/c/src/+/221363 > > Reviewed-by: Niels Moller <nisse@webrtc.org> > > Commit-Queue: Tommi <tommi@webrtc.org> > > Cr-Commit-Position: refs/heads/master@{#34252} > > TBR=saza@webrtc.org,nisse@webrtc.org,tommi@webrtc.org,webrtc-scoped@luci-project-accounts.iam.gserviceaccount.com > > Change-Id: I15ca2d8ee5fd612e13dc1f4b3bfb9c885c21dc66 > No-Presubmit: true > No-Tree-Checks: true > No-Try: true > Bug: webrtc:11993 > Reviewed-on: https://webrtc-review.googlesource.com/c/src/+/221746 > Commit-Queue: Artem Titov <titovartem@webrtc.org> > Reviewed-by: Andrey Logvin <landrey@webrtc.org> > Cr-Commit-Position: refs/heads/master@{#34253} # Not skipping CQ checks because this is a reland. Bug: webrtc:11993 Change-Id: I0d3bf9abdcdc8d3f9259d014e6074a5e6b6cc73c Reviewed-on: https://webrtc-review.googlesource.com/c/src/+/221747 Reviewed-by: Tommi <tommi@webrtc.org> Reviewed-by: Artem Titov <titovartem@webrtc.org> Reviewed-by: Andrey Logvin <landrey@webrtc.org> Commit-Queue: Tommi <tommi@webrtc.org> Cr-Commit-Position: refs/heads/master@{#34255}
2021-06-09 13:46:28 +02:00
// TODO(tommi): Remove this method.
void ReconfigureForTesting(
const webrtc::AudioReceiveStreamInterface::Config& config);
Reland "Remove AudioReceiveStream::Reconfigure() method." This reverts commit 8a18e5b3c954a3f9cc006c90356a3d850bcc352f. Reason for revert: Removing the problematic DCHECK. Original change's description: > Revert "Remove AudioReceiveStream::Reconfigure() method." > > This reverts commit e2561e17e29e62c02731f1d214d7ee5ffdaeb941. > > Reason for revert: Speculative revert: breaks an downstream project > > Original change's description: > > Remove AudioReceiveStream::Reconfigure() method. > > > > Instead, adding specific setters that are needed at runtime: > > * SetDepacketizerToDecoderFrameTransformer > > * SetDecoderMap > > * SetUseTransportCcAndNackHistory > > > > The whole config struct is big and much of the state it holds, needs to > > be considered const. For that reason the Reconfigure() method is too > > broad of an interface since it overwrites the whole config struct > > and doesn't actually handle all the potential config changes that might > > occur when the config changes. > > > > Bug: webrtc:11993 > > Change-Id: Ia5311978f56b2e136781467e44f0d18039f0bb2d > > Reviewed-on: https://webrtc-review.googlesource.com/c/src/+/221363 > > Reviewed-by: Niels Moller <nisse@webrtc.org> > > Commit-Queue: Tommi <tommi@webrtc.org> > > Cr-Commit-Position: refs/heads/master@{#34252} > > TBR=saza@webrtc.org,nisse@webrtc.org,tommi@webrtc.org,webrtc-scoped@luci-project-accounts.iam.gserviceaccount.com > > Change-Id: I15ca2d8ee5fd612e13dc1f4b3bfb9c885c21dc66 > No-Presubmit: true > No-Tree-Checks: true > No-Try: true > Bug: webrtc:11993 > Reviewed-on: https://webrtc-review.googlesource.com/c/src/+/221746 > Commit-Queue: Artem Titov <titovartem@webrtc.org> > Reviewed-by: Andrey Logvin <landrey@webrtc.org> > Cr-Commit-Position: refs/heads/master@{#34253} # Not skipping CQ checks because this is a reland. Bug: webrtc:11993 Change-Id: I0d3bf9abdcdc8d3f9259d014e6074a5e6b6cc73c Reviewed-on: https://webrtc-review.googlesource.com/c/src/+/221747 Reviewed-by: Tommi <tommi@webrtc.org> Reviewed-by: Artem Titov <titovartem@webrtc.org> Reviewed-by: Andrey Logvin <landrey@webrtc.org> Commit-Queue: Tommi <tommi@webrtc.org> Cr-Commit-Position: refs/heads/master@{#34255}
2021-06-09 13:46:28 +02:00
private:
internal::AudioState* audio_state() const;
RTC_NO_UNIQUE_ADDRESS SequenceChecker worker_thread_checker_;
// TODO(bugs.webrtc.org/11993): This checker conceptually represents
// operations that belong to the network thread. The Call class is currently
// moving towards handling network packets on the network thread and while
// that work is ongoing, this checker may in practice represent the worker
// thread, but still serves as a mechanism of grouping together concepts
// that belong to the network thread. Once the packets are fully delivered
// on the network thread, this comment will be deleted.
RTC_NO_UNIQUE_ADDRESS SequenceChecker packet_sequence_checker_;
webrtc::AudioReceiveStreamInterface::Config config_;
rtc::scoped_refptr<webrtc::AudioState> audio_state_;
Reland "Replace the implementation of `GetContributingSources()` on the audio side." This reverts commit 67008dfb366237469fe088a61b62c0cad852c024. Reason for revert: Tests in the Chromium repo have been changed to accomodate this CL: https://chromium-review.googlesource.com/c/chromium/src/+/1728565 Original change's description: > Revert "Replace the implementation of `GetContributingSources()` on the audio side." > > This reverts commit 8fa7151e4bbad40fec1f964fe0c003b8787bb78a. > > Reason for revert: Speculative revert to fix roll of webrtc into chrome. Right now tests related to RTCRtpReceiver failing and looks like it is main candidate, who can affect that behavior. > > Original change's description: > > Replace the implementation of `GetContributingSources()` on the audio side. > > > > This change replaces the `ContributingSources`-implementation of `GetContributingSources()` and `GetSynchronizationSources()` on the audio side with the spec-compliant `SourceTracker`-implementation. > > > > The most noticeable impact is that the per-frame dictionaries are now updated when frames are delivered to the RTCRtpReceiver's MediaStreamTrack rather than when RTP packets are received on the network. > > > > This change is almost identical to the previous video side change at: https://webrtc-review.googlesource.com/c/src/+/143177 > > > > Bug: webrtc:10545 > > Change-Id: Ife7f08ee8ca1346099b7466837a3756947085fc5 > > Reviewed-on: https://webrtc-review.googlesource.com/c/src/+/144422 > > Reviewed-by: Oskar Sundbom <ossu@webrtc.org> > > Commit-Queue: Chen Xing <chxg@google.com> > > Cr-Commit-Position: refs/heads/master@{#28459} > > TBR=ossu@webrtc.org,chxg@google.com > > Change-Id: I5c631d4dcfb39601055ffce9b104f45eea871fd3 > No-Presubmit: true > No-Tree-Checks: true > No-Try: true > Bug: webrtc:10545 > Reviewed-on: https://webrtc-review.googlesource.com/c/src/+/144562 > Reviewed-by: Artem Titov <titovartem@webrtc.org> > Commit-Queue: Artem Titov <titovartem@webrtc.org> > Cr-Commit-Position: refs/heads/master@{#28478} TBR=ossu@webrtc.org,titovartem@webrtc.org,chxg@google.com # Not skipping CQ checks because original CL landed > 1 day ago. Bug: webrtc:10545 Change-Id: I609cca4f0ca4e1d31a156ba9eb44407518409f57 Reviewed-on: https://webrtc-review.googlesource.com/c/src/+/147865 Reviewed-by: Henrik Boström <hbos@webrtc.org> Reviewed-by: Chen Xing <chxg@google.com> Commit-Queue: Chen Xing <chxg@google.com> Cr-Commit-Position: refs/heads/master@{#28746}
2019-08-02 10:29:26 +00:00
SourceTracker source_tracker_;
const std::unique_ptr<voe::ChannelReceiveInterface> channel_receive_;
AudioSendStream* associated_send_stream_
RTC_GUARDED_BY(packet_sequence_checker_) = nullptr;
bool playing_ RTC_GUARDED_BY(worker_thread_checker_) = false;
Replace AudioConferenceMixer with AudioMixer. This CL re-routes audio through AudioMixer instead of AudioConferenceMixer. This is done without any modifications to VoiceEngine. Previously, output audio was polled by an AudioDevice through an AudioTransport pointer, which was an instance of VoEBaseImpl. VoiceEngineImpl sent the request for data on to OutputMixer and further to AudioConferenceMixer. This CL changes the audio flow to an AudioDevice. We reconfigure the AudioDevice to have another AudioTransport pointer, which points to an AudioTransportProxy. The AudioTransportProxy is responsible for feeding mixed data to the AudioProcessing component for echo cancellation, and to resample the audio data after AudioProcessing and before it is sent to the AudioDevice. The set up of the audio path was previously done during VoiceEngine initialization. Now it is changed in the AudioState constructor. This list shows where audio-path-related VoiceEngine functionality has been moved: OutputMixer --> AudioTransportProxy VoiceEngineImpl --> AudioState, AudioTransportProxy SharedData --> AudioState Channel --> AudioReceiveStream, ChannelProxy, Channel AudioState owns the new mixer and connects it to AudioTransport and AudioDevice on initialization. The audio input source is AudioReceiveStream, which registers itself with the mixer (which it gets from AudioState) on Start and Stop. # Since the AudioTransport interface contains non-const references. NOPRESUBMIT=True BUG=webrtc:6346 Review-Url: https://codereview.webrtc.org/2436033002 Cr-Commit-Position: refs/heads/master@{#15193}
2016-11-22 06:42:53 -08:00
std::unique_ptr<RtpStreamReceiverInterface> rtp_stream_receiver_
RTC_GUARDED_BY(packet_sequence_checker_);
};
} // namespace webrtc
#endif // AUDIO_AUDIO_RECEIVE_STREAM_H_