2015-04-29 15:24:01 +02:00
|
|
|
/*
|
|
|
|
|
* 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.
|
|
|
|
|
*/
|
|
|
|
|
|
2017-09-15 06:47:31 +02:00
|
|
|
#include "audio/audio_receive_stream.h"
|
2015-04-29 15:24:01 +02:00
|
|
|
|
|
|
|
|
#include <string>
|
2015-12-12 01:37:01 +01:00
|
|
|
#include <utility>
|
2015-04-29 15:24:01 +02:00
|
|
|
|
2018-10-23 12:03:01 +02:00
|
|
|
#include "absl/memory/memory.h"
|
|
|
|
|
#include "api/array_view.h"
|
|
|
|
|
#include "api/audio_codecs/audio_format.h"
|
2017-09-15 06:47:31 +02:00
|
|
|
#include "api/call/audio_sink.h"
|
2019-01-11 09:11:00 -08:00
|
|
|
#include "api/rtp_parameters.h"
|
2021-05-29 13:21:28 +02:00
|
|
|
#include "api/sequence_checker.h"
|
2017-09-15 06:47:31 +02:00
|
|
|
#include "audio/audio_send_stream.h"
|
|
|
|
|
#include "audio/audio_state.h"
|
2018-10-23 12:03:01 +02:00
|
|
|
#include "audio/channel_receive.h"
|
2017-09-15 06:47:31 +02:00
|
|
|
#include "audio/conversion.h"
|
2018-10-23 12:03:01 +02:00
|
|
|
#include "call/rtp_config.h"
|
2017-09-15 06:47:31 +02:00
|
|
|
#include "call/rtp_stream_receiver_controller_interface.h"
|
2021-01-23 12:27:19 +05:30
|
|
|
#include "modules/rtp_rtcp/source/rtp_packet_received.h"
|
2017-09-15 06:47:31 +02:00
|
|
|
#include "rtc_base/checks.h"
|
|
|
|
|
#include "rtc_base/logging.h"
|
Adding a new string utility class: SimpleStringBuilder.
This is a fairly minimalistic string building class that
can be used instead of stringstream, which is discouraged
but tempting to use due to its convenient interface and
familiarity for anyone using our logging macros.
As a starter, I'm changing the string building code in
ReceiveStatisticsProxy and SendStatisticsProxy from using
stringstream and using SimpleStringBuilder instead.
In the case of SimpleStringBuilder, there's a single allocation,
it's done on the stack (fast), and minimal code is required for
each concatenation. The developer is responsible for ensuring
that the buffer size is adequate but the class won't overflow
the buffer. In dcheck-enabled builds, a check will go off if
we run out of buffer space.
As part of using SimpleStringBuilder for a small part of
rtc::LogMessage, a few more changes were made:
- SimpleStringBuilder is used for formatting errors instead of ostringstream.
- A new 'noop' state has been introduced for log messages that will be dropped.
- Use a static (singleton) noop ostream object for noop logging messages
instead of building up an actual ostringstream object that will be dropped.
- Add a LogMessageForTest class for better state inspection/testing.
- Fix benign bug in LogTest.Perf, change the test to not use File IO and
always enable it.
- Ensure that minimal work is done for noop messages.
- Remove dependency on rtc::Thread.
- Add tests for the extra_ field, correctly parsed paths and noop handling.
Bug: webrtc:8529, webrtc:4364, webrtc:8933
Change-Id: Ifa258c135135945e4560d9e24315f7d96f784acb
Reviewed-on: https://webrtc-review.googlesource.com/55520
Commit-Queue: Tommi <tommi@webrtc.org>
Reviewed-by: Karl Wiberg <kwiberg@webrtc.org>
Reviewed-by: Erik Språng <sprang@webrtc.org>
Reviewed-by: Jonas Olsson <jonasolsson@webrtc.org>
Cr-Commit-Position: refs/heads/master@{#22203}
2018-02-27 13:51:08 +01:00
|
|
|
#include "rtc_base/strings/string_builder.h"
|
2019-01-11 09:11:00 -08:00
|
|
|
#include "rtc_base/time_utils.h"
|
2015-04-29 15:24:01 +02:00
|
|
|
|
|
|
|
|
namespace webrtc {
|
2016-01-12 13:55:00 +01:00
|
|
|
|
2015-04-29 15:24:01 +02:00
|
|
|
std::string AudioReceiveStream::Config::Rtp::ToString() const {
|
2018-03-08 15:03:23 +01:00
|
|
|
char ss_buf[1024];
|
|
|
|
|
rtc::SimpleStringBuilder ss(ss_buf);
|
2015-04-29 15:24:01 +02:00
|
|
|
ss << "{remote_ssrc: " << remote_ssrc;
|
2015-10-27 03:35:21 -07:00
|
|
|
ss << ", local_ssrc: " << local_ssrc;
|
2016-06-14 12:13:00 -07:00
|
|
|
ss << ", transport_cc: " << (transport_cc ? "on" : "off");
|
|
|
|
|
ss << ", nack: " << nack.ToString();
|
2015-04-29 15:24:01 +02:00
|
|
|
ss << ", extensions: [";
|
|
|
|
|
for (size_t i = 0; i < extensions.size(); ++i) {
|
|
|
|
|
ss << extensions[i].ToString();
|
2015-10-22 10:49:27 +02:00
|
|
|
if (i != extensions.size() - 1) {
|
2015-04-29 15:24:01 +02:00
|
|
|
ss << ", ";
|
2015-10-22 10:49:27 +02:00
|
|
|
}
|
2015-04-29 15:24:01 +02:00
|
|
|
}
|
|
|
|
|
ss << ']';
|
|
|
|
|
ss << '}';
|
|
|
|
|
return ss.str();
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
std::string AudioReceiveStream::Config::ToString() const {
|
2018-03-08 15:03:23 +01:00
|
|
|
char ss_buf[1024];
|
|
|
|
|
rtc::SimpleStringBuilder ss(ss_buf);
|
2015-04-29 15:24:01 +02:00
|
|
|
ss << "{rtp: " << rtp.ToString();
|
2015-10-27 03:35:21 -07:00
|
|
|
ss << ", rtcp_send_transport: "
|
2017-02-26 04:18:12 -08:00
|
|
|
<< (rtcp_send_transport ? "(Transport)" : "null");
|
2015-10-22 10:49:27 +02:00
|
|
|
if (!sync_group.empty()) {
|
2015-07-15 08:02:58 -07:00
|
|
|
ss << ", sync_group: " << sync_group;
|
2015-10-22 10:49:27 +02:00
|
|
|
}
|
2015-04-29 15:24:01 +02:00
|
|
|
ss << '}';
|
|
|
|
|
return ss.str();
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
namespace internal {
|
2018-01-11 13:52:30 +01:00
|
|
|
namespace {
|
2018-11-16 09:50:42 +01:00
|
|
|
std::unique_ptr<voe::ChannelReceiveInterface> CreateChannelReceive(
|
2019-03-04 17:43:34 +01:00
|
|
|
Clock* clock,
|
2018-01-11 13:52:30 +01:00
|
|
|
webrtc::AudioState* audio_state,
|
2019-11-01 11:47:51 +01:00
|
|
|
NetEqFactory* neteq_factory,
|
2018-08-14 09:43:34 +02:00
|
|
|
const webrtc::AudioReceiveStream::Config& config,
|
|
|
|
|
RtcEventLog* event_log) {
|
2018-01-11 13:52:30 +01:00
|
|
|
RTC_DCHECK(audio_state);
|
|
|
|
|
internal::AudioState* internal_audio_state =
|
|
|
|
|
static_cast<internal::AudioState*>(audio_state);
|
2018-11-16 09:50:42 +01:00
|
|
|
return voe::CreateChannelReceive(
|
2021-06-22 10:46:48 +02:00
|
|
|
clock, neteq_factory, internal_audio_state->audio_device_module(),
|
|
|
|
|
config.rtcp_send_transport, event_log, config.rtp.local_ssrc,
|
|
|
|
|
config.rtp.remote_ssrc, config.jitter_buffer_max_packets,
|
|
|
|
|
config.jitter_buffer_fast_accelerate, config.jitter_buffer_min_delay_ms,
|
2019-01-10 15:58:36 +01:00
|
|
|
config.jitter_buffer_enable_rtx_handling, config.decoder_factory,
|
2021-06-09 13:46:28 +02:00
|
|
|
config.codec_pair_id, std::move(config.frame_decryptor),
|
|
|
|
|
config.crypto_options, std::move(config.frame_transformer));
|
2018-01-11 13:52:30 +01:00
|
|
|
}
|
|
|
|
|
} // namespace
|
|
|
|
|
|
2015-04-29 15:24:01 +02:00
|
|
|
AudioReceiveStream::AudioReceiveStream(
|
2019-03-04 17:43:34 +01:00
|
|
|
Clock* clock,
|
2016-11-30 03:35:20 -08:00
|
|
|
PacketRouter* packet_router,
|
2019-11-01 11:47:51 +01:00
|
|
|
NetEqFactory* neteq_factory,
|
2015-11-06 15:34:49 -08:00
|
|
|
const webrtc::AudioReceiveStream::Config& config,
|
2016-07-04 07:06:55 -07:00
|
|
|
const rtc::scoped_refptr<webrtc::AudioState>& audio_state,
|
|
|
|
|
webrtc::RtcEventLog* event_log)
|
2019-03-04 17:43:34 +01:00
|
|
|
: AudioReceiveStream(clock,
|
2018-01-11 13:52:30 +01:00
|
|
|
packet_router,
|
|
|
|
|
config,
|
|
|
|
|
audio_state,
|
|
|
|
|
event_log,
|
2019-03-04 17:43:34 +01:00
|
|
|
CreateChannelReceive(clock,
|
|
|
|
|
audio_state.get(),
|
2019-11-01 11:47:51 +01:00
|
|
|
neteq_factory,
|
2018-11-16 09:50:42 +01:00
|
|
|
config,
|
|
|
|
|
event_log)) {}
|
2018-01-11 13:52:30 +01:00
|
|
|
|
|
|
|
|
AudioReceiveStream::AudioReceiveStream(
|
2019-03-04 17:43:34 +01:00
|
|
|
Clock* clock,
|
2018-01-11 13:52:30 +01:00
|
|
|
PacketRouter* packet_router,
|
|
|
|
|
const webrtc::AudioReceiveStream::Config& config,
|
|
|
|
|
const rtc::scoped_refptr<webrtc::AudioState>& audio_state,
|
|
|
|
|
webrtc::RtcEventLog* event_log,
|
2018-11-16 09:50:42 +01:00
|
|
|
std::unique_ptr<voe::ChannelReceiveInterface> channel_receive)
|
2021-05-29 13:21:28 +02:00
|
|
|
: config_(config),
|
|
|
|
|
audio_state_(audio_state),
|
2021-01-23 12:27:19 +05:30
|
|
|
source_tracker_(clock),
|
|
|
|
|
channel_receive_(std::move(channel_receive)) {
|
2018-01-25 10:14:29 +01:00
|
|
|
RTC_LOG(LS_INFO) << "AudioReceiveStream: " << config.rtp.remote_ssrc;
|
2018-01-11 13:52:30 +01:00
|
|
|
RTC_DCHECK(config.decoder_factory);
|
2018-10-05 11:28:38 +02:00
|
|
|
RTC_DCHECK(config.rtcp_send_transport);
|
2018-01-11 13:52:30 +01:00
|
|
|
RTC_DCHECK(audio_state_);
|
2018-11-16 09:50:42 +01:00
|
|
|
RTC_DCHECK(channel_receive_);
|
2015-11-20 09:59:34 -08:00
|
|
|
|
2021-05-31 17:36:47 +02:00
|
|
|
packet_sequence_checker_.Detach();
|
2021-05-31 12:57:53 +02:00
|
|
|
|
2019-11-26 09:19:40 -08:00
|
|
|
RTC_DCHECK(packet_router);
|
|
|
|
|
// Configure bandwidth estimation.
|
|
|
|
|
channel_receive_->RegisterReceiverCongestionControlObjects(packet_router);
|
2018-01-10 15:17:10 +01:00
|
|
|
|
2021-01-23 12:27:19 +05:30
|
|
|
// When output is muted, ChannelReceive will directly notify the source
|
|
|
|
|
// tracker of "delivered" frames, so RtpReceiver information will continue to
|
|
|
|
|
// be updated.
|
|
|
|
|
channel_receive_->SetSourceTracker(&source_tracker_);
|
|
|
|
|
|
2021-05-29 13:21:28 +02:00
|
|
|
// Complete configuration.
|
|
|
|
|
// TODO(solenberg): Config NACK history window (which is a packet count),
|
|
|
|
|
// using the actual packet size for the configured codec.
|
|
|
|
|
channel_receive_->SetNACKStatus(config.rtp.nack.rtp_history_ms != 0,
|
|
|
|
|
config.rtp.nack.rtp_history_ms / 20);
|
|
|
|
|
channel_receive_->SetReceiveCodecs(config.decoder_map);
|
2021-06-09 13:46:28 +02:00
|
|
|
// `frame_transformer` and `frame_decryptor` have been given to
|
|
|
|
|
// `channel_receive_` already.
|
2015-04-29 15:24:01 +02:00
|
|
|
}
|
|
|
|
|
|
2015-10-15 05:22:13 -07:00
|
|
|
AudioReceiveStream::~AudioReceiveStream() {
|
2017-01-31 03:58:40 -08:00
|
|
|
RTC_DCHECK_RUN_ON(&worker_thread_checker_);
|
2018-01-25 10:14:29 +01:00
|
|
|
RTC_LOG(LS_INFO) << "~AudioReceiveStream: " << config_.rtp.remote_ssrc;
|
2017-12-18 22:41:03 +01:00
|
|
|
Stop();
|
2018-11-16 09:50:42 +01:00
|
|
|
channel_receive_->SetAssociatedSendChannel(nullptr);
|
2019-11-26 09:19:40 -08:00
|
|
|
channel_receive_->ResetReceiverCongestionControlObjects();
|
2015-10-15 05:22:13 -07:00
|
|
|
}
|
|
|
|
|
|
2021-05-31 12:57:53 +02:00
|
|
|
void AudioReceiveStream::RegisterWithTransport(
|
|
|
|
|
RtpStreamReceiverControllerInterface* receiver_controller) {
|
2021-05-31 17:36:47 +02:00
|
|
|
RTC_DCHECK_RUN_ON(&packet_sequence_checker_);
|
2021-05-31 12:57:53 +02:00
|
|
|
RTC_DCHECK(!rtp_stream_receiver_);
|
|
|
|
|
rtp_stream_receiver_ = receiver_controller->CreateReceiver(
|
|
|
|
|
config_.rtp.remote_ssrc, channel_receive_.get());
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
void AudioReceiveStream::UnregisterFromTransport() {
|
2021-05-31 17:36:47 +02:00
|
|
|
RTC_DCHECK_RUN_ON(&packet_sequence_checker_);
|
2021-05-31 12:57:53 +02:00
|
|
|
rtp_stream_receiver_.reset();
|
|
|
|
|
}
|
|
|
|
|
|
2021-06-09 13:46:28 +02:00
|
|
|
void AudioReceiveStream::ReconfigureForTesting(
|
2018-01-10 15:17:10 +01:00
|
|
|
const webrtc::AudioReceiveStream::Config& config) {
|
2021-06-09 13:46:28 +02:00
|
|
|
RTC_DCHECK_RUN_ON(&worker_thread_checker_);
|
|
|
|
|
|
|
|
|
|
// SSRC can't be changed mid-stream.
|
|
|
|
|
RTC_DCHECK_EQ(config_.rtp.remote_ssrc, config.rtp.remote_ssrc);
|
|
|
|
|
RTC_DCHECK_EQ(config_.rtp.local_ssrc, config.rtp.local_ssrc);
|
2021-05-29 13:21:28 +02:00
|
|
|
|
|
|
|
|
// Configuration parameters which cannot be changed.
|
2021-06-09 13:46:28 +02:00
|
|
|
RTC_DCHECK_EQ(config_.rtcp_send_transport, config.rtcp_send_transport);
|
2021-05-29 13:21:28 +02:00
|
|
|
// Decoder factory cannot be changed because it is configured at
|
|
|
|
|
// voe::Channel construction time.
|
2021-06-09 13:46:28 +02:00
|
|
|
RTC_DCHECK_EQ(config_.decoder_factory, config.decoder_factory);
|
2021-05-29 13:21:28 +02:00
|
|
|
|
|
|
|
|
// TODO(solenberg): Config NACK history window (which is a packet count),
|
|
|
|
|
// using the actual packet size for the configured codec.
|
2021-06-09 13:46:28 +02:00
|
|
|
RTC_DCHECK_EQ(config_.rtp.nack.rtp_history_ms, config.rtp.nack.rtp_history_ms)
|
|
|
|
|
<< "Use SetUseTransportCcAndNackHistory";
|
2021-05-29 13:21:28 +02:00
|
|
|
|
2021-06-09 13:46:28 +02:00
|
|
|
RTC_DCHECK(config_.decoder_map == config.decoder_map) << "Use SetDecoderMap";
|
|
|
|
|
RTC_DCHECK_EQ(config_.frame_transformer, config.frame_transformer)
|
|
|
|
|
<< "Use SetDepacketizerToDecoderFrameTransformer";
|
2021-05-29 13:21:28 +02:00
|
|
|
|
|
|
|
|
config_ = config;
|
2018-01-10 15:17:10 +01:00
|
|
|
}
|
|
|
|
|
|
2015-11-20 09:59:34 -08:00
|
|
|
void AudioReceiveStream::Start() {
|
2017-01-31 03:58:40 -08:00
|
|
|
RTC_DCHECK_RUN_ON(&worker_thread_checker_);
|
2016-11-22 06:42:53 -08:00
|
|
|
if (playing_) {
|
|
|
|
|
return;
|
|
|
|
|
}
|
2018-11-16 09:50:42 +01:00
|
|
|
channel_receive_->StartPlayout();
|
2016-11-22 06:42:53 -08:00
|
|
|
playing_ = true;
|
2017-12-18 22:41:03 +01:00
|
|
|
audio_state()->AddReceivingStream(this);
|
2015-11-20 09:59:34 -08:00
|
|
|
}
|
|
|
|
|
|
|
|
|
|
void AudioReceiveStream::Stop() {
|
2017-01-31 03:58:40 -08:00
|
|
|
RTC_DCHECK_RUN_ON(&worker_thread_checker_);
|
2016-11-22 06:42:53 -08:00
|
|
|
if (!playing_) {
|
|
|
|
|
return;
|
|
|
|
|
}
|
2018-11-16 09:50:42 +01:00
|
|
|
channel_receive_->StopPlayout();
|
2016-11-22 06:42:53 -08:00
|
|
|
playing_ = false;
|
2017-12-18 22:41:03 +01:00
|
|
|
audio_state()->RemoveReceivingStream(this);
|
2015-11-20 09:59:34 -08:00
|
|
|
}
|
|
|
|
|
|
2021-01-17 14:36:44 +01:00
|
|
|
bool AudioReceiveStream::IsRunning() const {
|
|
|
|
|
RTC_DCHECK_RUN_ON(&worker_thread_checker_);
|
|
|
|
|
return playing_;
|
|
|
|
|
}
|
|
|
|
|
|
2021-06-09 13:46:28 +02:00
|
|
|
void AudioReceiveStream::SetDepacketizerToDecoderFrameTransformer(
|
|
|
|
|
rtc::scoped_refptr<webrtc::FrameTransformerInterface> frame_transformer) {
|
|
|
|
|
RTC_DCHECK_RUN_ON(&worker_thread_checker_);
|
|
|
|
|
channel_receive_->SetDepacketizerToDecoderFrameTransformer(
|
|
|
|
|
std::move(frame_transformer));
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
void AudioReceiveStream::SetDecoderMap(
|
|
|
|
|
std::map<int, SdpAudioFormat> decoder_map) {
|
|
|
|
|
RTC_DCHECK_RUN_ON(&worker_thread_checker_);
|
|
|
|
|
config_.decoder_map = std::move(decoder_map);
|
|
|
|
|
channel_receive_->SetReceiveCodecs(config_.decoder_map);
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
void AudioReceiveStream::SetUseTransportCcAndNackHistory(bool use_transport_cc,
|
|
|
|
|
int history_ms) {
|
|
|
|
|
RTC_DCHECK_RUN_ON(&worker_thread_checker_);
|
|
|
|
|
RTC_DCHECK_GE(history_ms, 0);
|
|
|
|
|
config_.rtp.transport_cc = use_transport_cc;
|
|
|
|
|
if (config_.rtp.nack.rtp_history_ms != history_ms) {
|
|
|
|
|
config_.rtp.nack.rtp_history_ms = history_ms;
|
|
|
|
|
// TODO(solenberg): Config NACK history window (which is a packet count),
|
|
|
|
|
// using the actual packet size for the configured codec.
|
|
|
|
|
channel_receive_->SetNACKStatus(history_ms != 0, history_ms / 20);
|
|
|
|
|
}
|
|
|
|
|
}
|
|
|
|
|
|
2021-06-14 08:11:10 +02:00
|
|
|
void AudioReceiveStream::SetFrameDecryptor(
|
|
|
|
|
rtc::scoped_refptr<webrtc::FrameDecryptorInterface> frame_decryptor) {
|
|
|
|
|
// TODO(bugs.webrtc.org/11993): This is called via WebRtcAudioReceiveStream,
|
|
|
|
|
// expect to be called on the network thread.
|
|
|
|
|
RTC_DCHECK_RUN_ON(&worker_thread_checker_);
|
|
|
|
|
channel_receive_->SetFrameDecryptor(std::move(frame_decryptor));
|
|
|
|
|
}
|
|
|
|
|
|
2021-06-14 20:00:04 +02:00
|
|
|
void AudioReceiveStream::SetRtpExtensions(
|
|
|
|
|
std::vector<RtpExtension> extensions) {
|
|
|
|
|
// TODO(bugs.webrtc.org/11993): This is called via WebRtcAudioReceiveStream,
|
|
|
|
|
// expect to be called on the network thread.
|
|
|
|
|
RTC_DCHECK_RUN_ON(&worker_thread_checker_);
|
|
|
|
|
config_.rtp.extensions = std::move(extensions);
|
|
|
|
|
}
|
|
|
|
|
|
2020-09-14 10:47:50 +02:00
|
|
|
webrtc::AudioReceiveStream::Stats AudioReceiveStream::GetStats(
|
|
|
|
|
bool get_and_clear_legacy_stats) const {
|
2017-01-31 03:58:40 -08:00
|
|
|
RTC_DCHECK_RUN_ON(&worker_thread_checker_);
|
2015-10-22 10:49:27 +02:00
|
|
|
webrtc::AudioReceiveStream::Stats stats;
|
|
|
|
|
stats.remote_ssrc = config_.rtp.remote_ssrc;
|
2015-11-27 10:46:42 -08:00
|
|
|
|
2018-10-04 14:28:39 +02:00
|
|
|
webrtc::CallReceiveStatistics call_stats =
|
2018-11-16 09:50:42 +01:00
|
|
|
channel_receive_->GetRTCPStatistics();
|
2017-02-06 12:53:57 -08:00
|
|
|
// TODO(solenberg): Don't return here if we can't get the codec - return the
|
|
|
|
|
// stats we *can* get.
|
Remove CodecInst pt.2
The following APIs on AudioCodingModule are deprecated with this CL:
static int NumberOfCodecs();
static int Codec(int, CodecInst*);
static int Codec(const char*, CodecInst*, int, size_t);
static int Codec(const char*, int, size_t);
absl::optional<CodecInst> SendCodec() const;
bool RegisterReceiveCodec(int, const SdpAudioFormat&);
int RegisterExternalReceiveCodec(int, AudioDecoder*, int, int, const std::string&);
int UnregisterReceiveCodec(uint8_t);
int32_t ReceiveCodec(CodecInst*);
absl::optional<SdpAudioFormat> ReceiveFormat();
As well as this method on RtpRtcp module:
int32_t RegisterSendPayload(const CodecInst&);
Bug: webrtc:7626
Change-Id: I1230732136f1fe9048cf74afdeab767ca57ac9ce
Reviewed-on: https://webrtc-review.googlesource.com/c/113816
Commit-Queue: Fredrik Solenberg <solenberg@webrtc.org>
Reviewed-by: Karl Wiberg <kwiberg@webrtc.org>
Cr-Commit-Position: refs/heads/master@{#26025}
2018-12-11 12:22:10 +01:00
|
|
|
auto receive_codec = channel_receive_->GetReceiveCodec();
|
|
|
|
|
if (!receive_codec) {
|
2015-10-22 10:49:27 +02:00
|
|
|
return stats;
|
|
|
|
|
}
|
|
|
|
|
|
2019-10-09 15:01:33 +02:00
|
|
|
stats.payload_bytes_rcvd = call_stats.payload_bytes_rcvd;
|
|
|
|
|
stats.header_and_padding_bytes_rcvd =
|
|
|
|
|
call_stats.header_and_padding_bytes_rcvd;
|
2015-10-27 03:35:21 -07:00
|
|
|
stats.packets_rcvd = call_stats.packetsReceived;
|
|
|
|
|
stats.packets_lost = call_stats.cumulativeLost;
|
2021-07-01 11:16:05 +02:00
|
|
|
stats.nacks_sent = call_stats.nacks_sent;
|
2015-11-16 09:48:04 -08:00
|
|
|
stats.capture_start_ntp_time_ms = call_stats.capture_start_ntp_time_ms_;
|
2019-04-15 17:32:00 +02:00
|
|
|
stats.last_packet_received_timestamp_ms =
|
|
|
|
|
call_stats.last_packet_received_timestamp_ms;
|
Remove CodecInst pt.2
The following APIs on AudioCodingModule are deprecated with this CL:
static int NumberOfCodecs();
static int Codec(int, CodecInst*);
static int Codec(const char*, CodecInst*, int, size_t);
static int Codec(const char*, int, size_t);
absl::optional<CodecInst> SendCodec() const;
bool RegisterReceiveCodec(int, const SdpAudioFormat&);
int RegisterExternalReceiveCodec(int, AudioDecoder*, int, int, const std::string&);
int UnregisterReceiveCodec(uint8_t);
int32_t ReceiveCodec(CodecInst*);
absl::optional<SdpAudioFormat> ReceiveFormat();
As well as this method on RtpRtcp module:
int32_t RegisterSendPayload(const CodecInst&);
Bug: webrtc:7626
Change-Id: I1230732136f1fe9048cf74afdeab767ca57ac9ce
Reviewed-on: https://webrtc-review.googlesource.com/c/113816
Commit-Queue: Fredrik Solenberg <solenberg@webrtc.org>
Reviewed-by: Karl Wiberg <kwiberg@webrtc.org>
Cr-Commit-Position: refs/heads/master@{#26025}
2018-12-11 12:22:10 +01:00
|
|
|
stats.codec_name = receive_codec->second.name;
|
|
|
|
|
stats.codec_payload_type = receive_codec->first;
|
|
|
|
|
int clockrate_khz = receive_codec->second.clockrate_hz / 1000;
|
|
|
|
|
if (clockrate_khz > 0) {
|
|
|
|
|
stats.jitter_ms = call_stats.jitterSamples / clockrate_khz;
|
2015-10-22 10:49:27 +02:00
|
|
|
}
|
2018-11-16 09:50:42 +01:00
|
|
|
stats.delay_estimate_ms = channel_receive_->GetDelayEstimate();
|
|
|
|
|
stats.audio_level = channel_receive_->GetSpeechOutputLevelFullRange();
|
|
|
|
|
stats.total_output_energy = channel_receive_->GetTotalOutputEnergy();
|
|
|
|
|
stats.total_output_duration = channel_receive_->GetTotalOutputDuration();
|
2019-10-22 15:23:44 +02:00
|
|
|
stats.estimated_playout_ntp_timestamp_ms =
|
|
|
|
|
channel_receive_->GetCurrentEstimatedPlayoutNtpTimestampMs(
|
|
|
|
|
rtc::TimeMillis());
|
2015-10-22 10:49:27 +02:00
|
|
|
|
2015-11-16 09:48:04 -08:00
|
|
|
// Get jitter buffer and total delay (alg + jitter + playout) stats.
|
2020-09-14 10:47:50 +02:00
|
|
|
auto ns = channel_receive_->GetNetworkStatistics(get_and_clear_legacy_stats);
|
2021-07-07 15:53:38 +02:00
|
|
|
stats.packets_discarded = ns.packetsDiscarded;
|
2019-04-30 09:45:21 +02:00
|
|
|
stats.fec_packets_received = ns.fecPacketsReceived;
|
|
|
|
|
stats.fec_packets_discarded = ns.fecPacketsDiscarded;
|
2015-11-16 09:48:04 -08:00
|
|
|
stats.jitter_buffer_ms = ns.currentBufferSize;
|
|
|
|
|
stats.jitter_buffer_preferred_ms = ns.preferredBufferSize;
|
2017-08-24 17:15:13 -07:00
|
|
|
stats.total_samples_received = ns.totalSamplesReceived;
|
|
|
|
|
stats.concealed_samples = ns.concealedSamples;
|
2019-04-30 09:45:21 +02:00
|
|
|
stats.silent_concealed_samples = ns.silentConcealedSamples;
|
2017-09-18 09:28:20 +02:00
|
|
|
stats.concealment_events = ns.concealmentEvents;
|
2017-10-02 12:00:34 +02:00
|
|
|
stats.jitter_buffer_delay_seconds =
|
|
|
|
|
static_cast<double>(ns.jitterBufferDelayMs) /
|
|
|
|
|
static_cast<double>(rtc::kNumMillisecsPerSec);
|
2019-01-15 15:46:29 +01:00
|
|
|
stats.jitter_buffer_emitted_count = ns.jitterBufferEmittedCount;
|
2020-03-11 11:18:54 +01:00
|
|
|
stats.jitter_buffer_target_delay_seconds =
|
|
|
|
|
static_cast<double>(ns.jitterBufferTargetDelayMs) /
|
|
|
|
|
static_cast<double>(rtc::kNumMillisecsPerSec);
|
2019-04-30 09:45:21 +02:00
|
|
|
stats.inserted_samples_for_deceleration = ns.insertedSamplesForDeceleration;
|
|
|
|
|
stats.removed_samples_for_acceleration = ns.removedSamplesForAcceleration;
|
2015-11-16 09:48:04 -08:00
|
|
|
stats.expand_rate = Q14ToFloat(ns.currentExpandRate);
|
|
|
|
|
stats.speech_expand_rate = Q14ToFloat(ns.currentSpeechExpandRate);
|
|
|
|
|
stats.secondary_decoded_rate = Q14ToFloat(ns.currentSecondaryDecodedRate);
|
2017-08-28 13:51:27 +02:00
|
|
|
stats.secondary_discarded_rate = Q14ToFloat(ns.currentSecondaryDiscardedRate);
|
2015-11-16 09:48:04 -08:00
|
|
|
stats.accelerate_rate = Q14ToFloat(ns.currentAccelerateRate);
|
|
|
|
|
stats.preemptive_expand_rate = Q14ToFloat(ns.currentPreemptiveRate);
|
2018-11-22 17:21:10 +01:00
|
|
|
stats.jitter_buffer_flushes = ns.packetBufferFlushes;
|
2018-11-27 12:52:16 +01:00
|
|
|
stats.delayed_packet_outage_samples = ns.delayedPacketOutageSamples;
|
2019-03-06 09:18:40 +01:00
|
|
|
stats.relative_packet_arrival_delay_seconds =
|
|
|
|
|
static_cast<double>(ns.relativePacketArrivalDelayMs) /
|
|
|
|
|
static_cast<double>(rtc::kNumMillisecsPerSec);
|
2019-04-29 17:00:46 +02:00
|
|
|
stats.interruption_count = ns.interruptionCount;
|
|
|
|
|
stats.total_interruption_duration_ms = ns.totalInterruptionDurationMs;
|
2015-10-22 10:49:27 +02:00
|
|
|
|
2018-11-16 09:50:42 +01:00
|
|
|
auto ds = channel_receive_->GetDecodingCallStatistics();
|
2015-11-16 09:48:04 -08:00
|
|
|
stats.decoding_calls_to_silence_generator = ds.calls_to_silence_generator;
|
|
|
|
|
stats.decoding_calls_to_neteq = ds.calls_to_neteq;
|
|
|
|
|
stats.decoding_normal = ds.decoded_normal;
|
2019-08-07 18:15:08 +02:00
|
|
|
stats.decoding_plc = ds.decoded_neteq_plc;
|
|
|
|
|
stats.decoding_codec_plc = ds.decoded_codec_plc;
|
2015-11-16 09:48:04 -08:00
|
|
|
stats.decoding_cng = ds.decoded_cng;
|
|
|
|
|
stats.decoding_plc_cng = ds.decoded_plc_cng;
|
2016-09-20 01:47:12 -07:00
|
|
|
stats.decoding_muted_output = ds.decoded_muted_output;
|
2015-10-22 10:49:27 +02:00
|
|
|
|
2021-03-23 17:23:04 +01:00
|
|
|
stats.last_sender_report_timestamp_ms =
|
|
|
|
|
call_stats.last_sender_report_timestamp_ms;
|
|
|
|
|
stats.last_sender_report_remote_timestamp_ms =
|
|
|
|
|
call_stats.last_sender_report_remote_timestamp_ms;
|
|
|
|
|
stats.sender_reports_packets_sent = call_stats.sender_reports_packets_sent;
|
|
|
|
|
stats.sender_reports_bytes_sent = call_stats.sender_reports_bytes_sent;
|
|
|
|
|
stats.sender_reports_reports_count = call_stats.sender_reports_reports_count;
|
|
|
|
|
|
2015-10-22 10:49:27 +02:00
|
|
|
return stats;
|
2015-06-08 13:04:56 +02:00
|
|
|
}
|
|
|
|
|
|
2018-01-11 13:52:30 +01:00
|
|
|
void AudioReceiveStream::SetSink(AudioSinkInterface* sink) {
|
2017-01-31 03:58:40 -08:00
|
|
|
RTC_DCHECK_RUN_ON(&worker_thread_checker_);
|
2018-11-16 09:50:42 +01:00
|
|
|
channel_receive_->SetSink(sink);
|
2015-12-12 01:37:01 +01:00
|
|
|
}
|
|
|
|
|
|
2016-06-17 08:30:54 -07:00
|
|
|
void AudioReceiveStream::SetGain(float gain) {
|
2017-01-31 03:58:40 -08:00
|
|
|
RTC_DCHECK_RUN_ON(&worker_thread_checker_);
|
2018-11-16 09:50:42 +01:00
|
|
|
channel_receive_->SetChannelOutputVolumeScaling(gain);
|
2016-06-17 08:30:54 -07:00
|
|
|
}
|
|
|
|
|
|
2019-02-06 09:45:56 +01:00
|
|
|
bool AudioReceiveStream::SetBaseMinimumPlayoutDelayMs(int delay_ms) {
|
|
|
|
|
RTC_DCHECK_RUN_ON(&worker_thread_checker_);
|
|
|
|
|
return channel_receive_->SetBaseMinimumPlayoutDelayMs(delay_ms);
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
int AudioReceiveStream::GetBaseMinimumPlayoutDelayMs() const {
|
|
|
|
|
RTC_DCHECK_RUN_ON(&worker_thread_checker_);
|
|
|
|
|
return channel_receive_->GetBaseMinimumPlayoutDelayMs();
|
|
|
|
|
}
|
|
|
|
|
|
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<RtpSource> AudioReceiveStream::GetSources() const {
|
|
|
|
|
RTC_DCHECK_RUN_ON(&worker_thread_checker_);
|
2019-08-02 10:29:26 +00:00
|
|
|
return source_tracker_.GetSources();
|
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
|
|
|
}
|
|
|
|
|
|
2017-01-31 03:58:40 -08:00
|
|
|
AudioMixer::Source::AudioFrameInfo AudioReceiveStream::GetAudioFrameWithInfo(
|
|
|
|
|
int sample_rate_hz,
|
|
|
|
|
AudioFrame* audio_frame) {
|
2019-08-02 10:29:26 +00:00
|
|
|
AudioMixer::Source::AudioFrameInfo audio_frame_info =
|
|
|
|
|
channel_receive_->GetAudioFrameWithInfo(sample_rate_hz, audio_frame);
|
|
|
|
|
if (audio_frame_info != AudioMixer::Source::AudioFrameInfo::kError) {
|
|
|
|
|
source_tracker_.OnFrameDelivered(audio_frame->packet_infos_);
|
|
|
|
|
}
|
|
|
|
|
return audio_frame_info;
|
2017-01-31 03:58:40 -08:00
|
|
|
}
|
|
|
|
|
|
|
|
|
|
int AudioReceiveStream::Ssrc() const {
|
|
|
|
|
return config_.rtp.remote_ssrc;
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
int AudioReceiveStream::PreferredSampleRate() const {
|
2018-11-16 09:50:42 +01:00
|
|
|
return channel_receive_->PreferredSampleRate();
|
2017-01-31 03:58:40 -08:00
|
|
|
}
|
|
|
|
|
|
2020-02-10 16:33:29 +01:00
|
|
|
uint32_t AudioReceiveStream::id() const {
|
2017-01-31 03:58:40 -08:00
|
|
|
RTC_DCHECK_RUN_ON(&worker_thread_checker_);
|
|
|
|
|
return config_.rtp.remote_ssrc;
|
|
|
|
|
}
|
|
|
|
|
|
2018-06-15 12:28:07 +02:00
|
|
|
absl::optional<Syncable::Info> AudioReceiveStream::GetInfo() const {
|
2021-04-01 20:12:04 +02:00
|
|
|
// TODO(bugs.webrtc.org/11993): This is called via RtpStreamsSynchronizer,
|
|
|
|
|
// expect to be called on the network thread.
|
|
|
|
|
RTC_DCHECK_RUN_ON(&worker_thread_checker_);
|
|
|
|
|
return channel_receive_->GetSyncInfo();
|
2017-01-31 03:58:40 -08:00
|
|
|
}
|
|
|
|
|
|
2019-10-22 15:23:44 +02:00
|
|
|
bool AudioReceiveStream::GetPlayoutRtpTimestamp(uint32_t* rtp_timestamp,
|
|
|
|
|
int64_t* time_ms) const {
|
2017-01-31 03:58:40 -08:00
|
|
|
// Called on video capture thread.
|
2019-10-22 15:23:44 +02:00
|
|
|
return channel_receive_->GetPlayoutRtpTimestamp(rtp_timestamp, time_ms);
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
void AudioReceiveStream::SetEstimatedPlayoutNtpTimestampMs(
|
|
|
|
|
int64_t ntp_timestamp_ms,
|
|
|
|
|
int64_t time_ms) {
|
|
|
|
|
// Called on video capture thread.
|
|
|
|
|
channel_receive_->SetEstimatedPlayoutNtpTimestampMs(ntp_timestamp_ms,
|
|
|
|
|
time_ms);
|
2017-01-31 03:58:40 -08:00
|
|
|
}
|
|
|
|
|
|
2020-09-08 16:30:25 +02:00
|
|
|
bool AudioReceiveStream::SetMinimumPlayoutDelay(int delay_ms) {
|
2021-04-01 20:12:04 +02:00
|
|
|
// TODO(bugs.webrtc.org/11993): This is called via RtpStreamsSynchronizer,
|
|
|
|
|
// expect to be called on the network thread.
|
|
|
|
|
RTC_DCHECK_RUN_ON(&worker_thread_checker_);
|
2018-11-16 09:50:42 +01:00
|
|
|
return channel_receive_->SetMinimumPlayoutDelay(delay_ms);
|
2015-10-15 05:22:13 -07:00
|
|
|
}
|
|
|
|
|
|
2016-11-14 11:30:07 -08:00
|
|
|
void AudioReceiveStream::AssociateSendStream(AudioSendStream* send_stream) {
|
2021-05-31 17:36:47 +02:00
|
|
|
RTC_DCHECK_RUN_ON(&packet_sequence_checker_);
|
2018-11-16 09:50:42 +01:00
|
|
|
channel_receive_->SetAssociatedSendChannel(
|
|
|
|
|
send_stream ? send_stream->GetChannel() : nullptr);
|
2018-01-11 13:52:30 +01:00
|
|
|
associated_send_stream_ = send_stream;
|
2016-11-14 11:30:07 -08:00
|
|
|
}
|
|
|
|
|
|
2019-03-05 14:29:42 +01:00
|
|
|
void AudioReceiveStream::DeliverRtcp(const uint8_t* packet, size_t length) {
|
2016-05-01 20:18:34 -07:00
|
|
|
// TODO(solenberg): Tests call this function on a network thread, libjingle
|
|
|
|
|
// calls on the worker thread. We should move towards always using a network
|
|
|
|
|
// thread. Then this check can be enabled.
|
2019-04-08 15:20:44 +02:00
|
|
|
// RTC_DCHECK(!thread_checker_.IsCurrent());
|
2019-03-05 14:29:42 +01:00
|
|
|
channel_receive_->ReceivedRTCPPacket(packet, length);
|
2016-05-01 20:18:34 -07:00
|
|
|
}
|
|
|
|
|
|
2021-06-16 16:31:18 +02:00
|
|
|
void AudioReceiveStream::SetSyncGroup(const std::string& sync_group) {
|
|
|
|
|
RTC_DCHECK_RUN_ON(&packet_sequence_checker_);
|
|
|
|
|
config_.sync_group = sync_group;
|
|
|
|
|
}
|
|
|
|
|
|
2021-06-15 23:01:57 +02:00
|
|
|
void AudioReceiveStream::SetLocalSsrc(uint32_t local_ssrc) {
|
|
|
|
|
RTC_DCHECK_RUN_ON(&packet_sequence_checker_);
|
|
|
|
|
// TODO(tommi): Consider storing local_ssrc in one place.
|
|
|
|
|
config_.rtp.local_ssrc = local_ssrc;
|
|
|
|
|
channel_receive_->OnLocalSsrcChange(local_ssrc);
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
uint32_t AudioReceiveStream::local_ssrc() const {
|
|
|
|
|
RTC_DCHECK_RUN_ON(&packet_sequence_checker_);
|
|
|
|
|
RTC_DCHECK_EQ(config_.rtp.local_ssrc, channel_receive_->GetLocalSsrc());
|
|
|
|
|
return config_.rtp.local_ssrc;
|
|
|
|
|
}
|
|
|
|
|
|
2017-01-31 03:58:40 -08:00
|
|
|
const webrtc::AudioReceiveStream::Config& AudioReceiveStream::config() const {
|
|
|
|
|
RTC_DCHECK_RUN_ON(&worker_thread_checker_);
|
|
|
|
|
return config_;
|
2016-10-31 03:26:40 -07:00
|
|
|
}
|
|
|
|
|
|
2018-01-11 13:52:30 +01:00
|
|
|
const AudioSendStream* AudioReceiveStream::GetAssociatedSendStreamForTesting()
|
|
|
|
|
const {
|
2021-05-31 17:36:47 +02:00
|
|
|
RTC_DCHECK_RUN_ON(&packet_sequence_checker_);
|
2018-01-11 13:52:30 +01:00
|
|
|
return associated_send_stream_;
|
2016-10-20 06:32:39 -07:00
|
|
|
}
|
|
|
|
|
|
2016-11-22 06:42:53 -08:00
|
|
|
internal::AudioState* AudioReceiveStream::audio_state() const {
|
|
|
|
|
auto* audio_state = static_cast<internal::AudioState*>(audio_state_.get());
|
|
|
|
|
RTC_DCHECK(audio_state);
|
|
|
|
|
return audio_state;
|
|
|
|
|
}
|
2015-04-29 15:24:01 +02:00
|
|
|
} // namespace internal
|
|
|
|
|
} // namespace webrtc
|