2013-05-16 12:08:03 +00:00
|
|
|
/*
|
|
|
|
|
* Copyright (c) 2013 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.
|
|
|
|
|
*/
|
|
|
|
|
|
2013-08-05 16:22:53 +00:00
|
|
|
#include <string.h>
|
2016-06-09 17:21:19 +02:00
|
|
|
#include <algorithm>
|
2013-05-16 12:08:03 +00:00
|
|
|
#include <map>
|
2016-03-12 06:10:44 -08:00
|
|
|
#include <memory>
|
2016-12-07 04:52:58 -08:00
|
|
|
#include <set>
|
2016-10-23 23:37:14 -07:00
|
|
|
#include <utility>
|
2013-05-16 12:08:03 +00:00
|
|
|
#include <vector>
|
|
|
|
|
|
2015-09-25 13:58:30 +02:00
|
|
|
#include "webrtc/audio/audio_receive_stream.h"
|
2015-10-16 14:35:07 -07:00
|
|
|
#include "webrtc/audio/audio_send_stream.h"
|
2015-11-06 15:34:49 -08:00
|
|
|
#include "webrtc/audio/audio_state.h"
|
|
|
|
|
#include "webrtc/audio/scoped_voe_interface.h"
|
2017-07-19 00:39:19 -07:00
|
|
|
#include "webrtc/audio/time_interval.h"
|
2015-11-12 21:02:42 -08:00
|
|
|
#include "webrtc/call/bitrate_allocator.h"
|
2016-12-07 04:52:58 -08:00
|
|
|
#include "webrtc/call/call.h"
|
2016-12-19 01:13:46 -08:00
|
|
|
#include "webrtc/call/flexfec_receive_stream_impl.h"
|
2017-06-21 01:05:22 -07:00
|
|
|
#include "webrtc/call/rtp_stream_receiver_controller.h"
|
2017-03-27 05:36:15 -07:00
|
|
|
#include "webrtc/call/rtp_transport_controller_send.h"
|
2013-12-05 12:11:47 +00:00
|
|
|
#include "webrtc/config.h"
|
Moved RtcEventLog files from call/ to logging/
The RtcEventLog headers need to be accessible from any place which needs
logging, and the implementation needs access to data structures that are
logged.
After a discussion in the code review, we all agreed to move the RtcEventLog implementation into its own top level directory - which I called "logging/" in expectation that other types of logging may have similar requirements. The directory contains two main build targets - "rtc_event_log_api", which is just rtc_event_log.h, that has no external dependencies and can be used from anywhere, and "rtc_event_log_impl" which contains the rest of the implementation and has many dependencies (more in the future).
The "api" target can be referenced from anywhere, while the "impl" target is only needed at the place of instantiation (currently Call, soon to be moved to PeerConnection by https://codereview.webrtc.org/2353033005/).
This change allows using RtcEventLog in the p2p/ directory, so that we
can log STUN pings and ICE state transitions.
BUG=webrtc:6393
R=kjellander@webrtc.org, kwiberg@webrtc.org, solenberg@webrtc.org, stefan@webrtc.org, terelius@webrtc.org
Review URL: https://codereview.webrtc.org/2380683005 .
Cr-Commit-Position: refs/heads/master@{#14485}
2016-10-03 18:31:22 -07:00
|
|
|
#include "webrtc/logging/rtc_event_log/rtc_event_log.h"
|
2015-11-12 21:02:42 -08:00
|
|
|
#include "webrtc/modules/bitrate_controller/include/bitrate_controller.h"
|
2017-03-21 06:41:12 -07:00
|
|
|
#include "webrtc/modules/congestion_controller/include/receive_side_congestion_controller.h"
|
2015-11-16 11:12:24 +01:00
|
|
|
#include "webrtc/modules/pacing/paced_sender.h"
|
2016-10-18 23:50:45 -07:00
|
|
|
#include "webrtc/modules/rtp_rtcp/include/flexfec_receiver.h"
|
2017-06-12 15:05:44 +02:00
|
|
|
#include "webrtc/modules/rtp_rtcp/include/rtp_header_extension_map.h"
|
2015-11-04 08:31:52 +01:00
|
|
|
#include "webrtc/modules/rtp_rtcp/include/rtp_header_parser.h"
|
2015-01-28 12:37:36 +00:00
|
|
|
#include "webrtc/modules/rtp_rtcp/source/byte_io.h"
|
2016-12-21 06:37:18 -08:00
|
|
|
#include "webrtc/modules/rtp_rtcp/source/rtp_packet_received.h"
|
2015-11-04 08:31:52 +01:00
|
|
|
#include "webrtc/modules/utility/include/process_thread.h"
|
2017-07-06 19:44:34 +02:00
|
|
|
#include "webrtc/rtc_base/basictypes.h"
|
|
|
|
|
#include "webrtc/rtc_base/checks.h"
|
|
|
|
|
#include "webrtc/rtc_base/constructormagic.h"
|
|
|
|
|
#include "webrtc/rtc_base/location.h"
|
|
|
|
|
#include "webrtc/rtc_base/logging.h"
|
|
|
|
|
#include "webrtc/rtc_base/optional.h"
|
|
|
|
|
#include "webrtc/rtc_base/ptr_util.h"
|
|
|
|
|
#include "webrtc/rtc_base/task_queue.h"
|
|
|
|
|
#include "webrtc/rtc_base/thread_annotations.h"
|
|
|
|
|
#include "webrtc/rtc_base/thread_checker.h"
|
|
|
|
|
#include "webrtc/rtc_base/trace_event.h"
|
2016-07-04 07:06:55 -07:00
|
|
|
#include "webrtc/system_wrappers/include/clock.h"
|
2015-10-28 18:17:40 +01:00
|
|
|
#include "webrtc/system_wrappers/include/cpu_info.h"
|
2015-11-11 10:13:02 -08:00
|
|
|
#include "webrtc/system_wrappers/include/metrics.h"
|
2015-10-28 18:17:40 +01:00
|
|
|
#include "webrtc/system_wrappers/include/rw_lock_wrapper.h"
|
|
|
|
|
#include "webrtc/system_wrappers/include/trace.h"
|
2015-12-09 12:13:30 +01:00
|
|
|
#include "webrtc/video/call_stats.h"
|
2016-05-02 23:44:01 -07:00
|
|
|
#include "webrtc/video/send_delay_stats.h"
|
2016-09-08 00:07:21 -07:00
|
|
|
#include "webrtc/video/stats_counter.h"
|
2013-10-28 16:32:01 +00:00
|
|
|
#include "webrtc/video/video_receive_stream.h"
|
|
|
|
|
#include "webrtc/video/video_send_stream.h"
|
2013-05-16 12:08:03 +00:00
|
|
|
|
|
|
|
|
namespace webrtc {
|
2014-09-17 09:02:25 +00:00
|
|
|
|
2017-02-07 01:18:43 -08:00
|
|
|
namespace {
|
|
|
|
|
|
|
|
|
|
// TODO(nisse): This really begs for a shared context struct.
|
|
|
|
|
bool UseSendSideBwe(const std::vector<RtpExtension>& extensions,
|
|
|
|
|
bool transport_cc) {
|
|
|
|
|
if (!transport_cc)
|
|
|
|
|
return false;
|
|
|
|
|
for (const auto& extension : extensions) {
|
|
|
|
|
if (extension.uri == RtpExtension::kTransportSequenceNumberUri)
|
|
|
|
|
return true;
|
|
|
|
|
}
|
|
|
|
|
return false;
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
bool UseSendSideBwe(const VideoReceiveStream::Config& config) {
|
|
|
|
|
return UseSendSideBwe(config.rtp.extensions, config.rtp.transport_cc);
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
bool UseSendSideBwe(const AudioReceiveStream::Config& config) {
|
|
|
|
|
return UseSendSideBwe(config.rtp.extensions, config.rtp.transport_cc);
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
bool UseSendSideBwe(const FlexfecReceiveStream::Config& config) {
|
|
|
|
|
return UseSendSideBwe(config.rtp_header_extensions, config.transport_cc);
|
|
|
|
|
}
|
|
|
|
|
|
2017-05-22 03:26:49 -07:00
|
|
|
rtclog::StreamConfig CreateRtcLogStreamConfig(
|
|
|
|
|
const VideoReceiveStream::Config& config) {
|
|
|
|
|
rtclog::StreamConfig rtclog_config;
|
|
|
|
|
rtclog_config.remote_ssrc = config.rtp.remote_ssrc;
|
|
|
|
|
rtclog_config.local_ssrc = config.rtp.local_ssrc;
|
|
|
|
|
rtclog_config.rtx_ssrc = config.rtp.rtx_ssrc;
|
|
|
|
|
rtclog_config.rtcp_mode = config.rtp.rtcp_mode;
|
|
|
|
|
rtclog_config.remb = config.rtp.remb;
|
|
|
|
|
rtclog_config.rtp_extensions = config.rtp.extensions;
|
|
|
|
|
|
|
|
|
|
for (const auto& d : config.decoders) {
|
|
|
|
|
auto search = config.rtp.rtx_payload_types.find(d.payload_type);
|
|
|
|
|
rtclog_config.codecs.emplace_back(
|
|
|
|
|
d.payload_name, d.payload_type,
|
|
|
|
|
search != config.rtp.rtx_payload_types.end() ? search->second : 0);
|
|
|
|
|
}
|
|
|
|
|
return rtclog_config;
|
|
|
|
|
}
|
|
|
|
|
|
2017-05-22 04:08:28 -07:00
|
|
|
rtclog::StreamConfig CreateRtcLogStreamConfig(
|
|
|
|
|
const VideoSendStream::Config& config,
|
|
|
|
|
size_t ssrc_index) {
|
|
|
|
|
rtclog::StreamConfig rtclog_config;
|
|
|
|
|
rtclog_config.local_ssrc = config.rtp.ssrcs[ssrc_index];
|
|
|
|
|
if (ssrc_index < config.rtp.rtx.ssrcs.size()) {
|
|
|
|
|
rtclog_config.rtx_ssrc = config.rtp.rtx.ssrcs[ssrc_index];
|
|
|
|
|
}
|
|
|
|
|
rtclog_config.rtcp_mode = config.rtp.rtcp_mode;
|
|
|
|
|
rtclog_config.rtp_extensions = config.rtp.extensions;
|
|
|
|
|
|
|
|
|
|
rtclog_config.codecs.emplace_back(config.encoder_settings.payload_name,
|
|
|
|
|
config.encoder_settings.payload_type,
|
|
|
|
|
config.rtp.rtx.payload_type);
|
|
|
|
|
return rtclog_config;
|
|
|
|
|
}
|
|
|
|
|
|
2017-05-22 09:36:28 -07:00
|
|
|
rtclog::StreamConfig CreateRtcLogStreamConfig(
|
|
|
|
|
const AudioReceiveStream::Config& config) {
|
|
|
|
|
rtclog::StreamConfig rtclog_config;
|
|
|
|
|
rtclog_config.remote_ssrc = config.rtp.remote_ssrc;
|
|
|
|
|
rtclog_config.local_ssrc = config.rtp.local_ssrc;
|
|
|
|
|
rtclog_config.rtp_extensions = config.rtp.extensions;
|
|
|
|
|
return rtclog_config;
|
|
|
|
|
}
|
|
|
|
|
|
2017-05-22 10:12:26 -07:00
|
|
|
rtclog::StreamConfig CreateRtcLogStreamConfig(
|
|
|
|
|
const AudioSendStream::Config& config) {
|
|
|
|
|
rtclog::StreamConfig rtclog_config;
|
|
|
|
|
rtclog_config.local_ssrc = config.rtp.ssrc;
|
|
|
|
|
rtclog_config.rtp_extensions = config.rtp.extensions;
|
|
|
|
|
if (config.send_codec_spec) {
|
|
|
|
|
rtclog_config.codecs.emplace_back(config.send_codec_spec->format.name,
|
|
|
|
|
config.send_codec_spec->payload_type, 0);
|
|
|
|
|
}
|
|
|
|
|
return rtclog_config;
|
|
|
|
|
}
|
|
|
|
|
|
2017-02-07 01:18:43 -08:00
|
|
|
} // namespace
|
|
|
|
|
|
2013-10-28 16:32:01 +00:00
|
|
|
namespace internal {
|
2014-01-31 10:05:07 +00:00
|
|
|
|
2016-05-11 06:01:13 -07:00
|
|
|
class Call : public webrtc::Call,
|
|
|
|
|
public PacketReceiver,
|
2016-10-18 23:50:45 -07:00
|
|
|
public RecoveredPacketReceiver,
|
2017-03-21 06:41:12 -07:00
|
|
|
public SendSideCongestionController::Observer,
|
2016-06-15 00:47:53 -07:00
|
|
|
public BitrateAllocator::LimitObserver {
|
2013-10-28 16:32:01 +00:00
|
|
|
public:
|
2017-03-27 05:36:15 -07:00
|
|
|
Call(const Call::Config& config,
|
2017-05-08 11:52:38 -07:00
|
|
|
std::unique_ptr<RtpTransportControllerSendInterface> transport_send);
|
2013-10-28 16:32:01 +00:00
|
|
|
virtual ~Call();
|
|
|
|
|
|
2016-10-23 23:37:14 -07:00
|
|
|
// Implements webrtc::Call.
|
2015-03-04 12:58:35 +00:00
|
|
|
PacketReceiver* Receiver() override;
|
2013-10-28 16:32:01 +00:00
|
|
|
|
2015-06-08 13:04:56 +02:00
|
|
|
webrtc::AudioSendStream* CreateAudioSendStream(
|
|
|
|
|
const webrtc::AudioSendStream::Config& config) override;
|
|
|
|
|
void DestroyAudioSendStream(webrtc::AudioSendStream* send_stream) override;
|
|
|
|
|
|
2015-04-29 15:24:01 +02:00
|
|
|
webrtc::AudioReceiveStream* CreateAudioReceiveStream(
|
|
|
|
|
const webrtc::AudioReceiveStream::Config& config) override;
|
|
|
|
|
void DestroyAudioReceiveStream(
|
|
|
|
|
webrtc::AudioReceiveStream* receive_stream) override;
|
2013-10-28 16:32:01 +00:00
|
|
|
|
2015-04-29 15:24:01 +02:00
|
|
|
webrtc::VideoSendStream* CreateVideoSendStream(
|
2016-09-01 01:17:40 -07:00
|
|
|
webrtc::VideoSendStream::Config config,
|
|
|
|
|
VideoEncoderConfig encoder_config) override;
|
2015-03-04 12:58:35 +00:00
|
|
|
void DestroyVideoSendStream(webrtc::VideoSendStream* send_stream) override;
|
2013-10-28 16:32:01 +00:00
|
|
|
|
2015-04-29 15:24:01 +02:00
|
|
|
webrtc::VideoReceiveStream* CreateVideoReceiveStream(
|
2016-06-10 17:58:01 +02:00
|
|
|
webrtc::VideoReceiveStream::Config configuration) override;
|
2015-03-04 12:58:35 +00:00
|
|
|
void DestroyVideoReceiveStream(
|
|
|
|
|
webrtc::VideoReceiveStream* receive_stream) override;
|
2013-10-28 16:32:01 +00:00
|
|
|
|
2016-12-19 01:13:46 -08:00
|
|
|
FlexfecReceiveStream* CreateFlexfecReceiveStream(
|
|
|
|
|
const FlexfecReceiveStream::Config& config) override;
|
2016-10-23 23:37:14 -07:00
|
|
|
void DestroyFlexfecReceiveStream(
|
2016-12-19 01:13:46 -08:00
|
|
|
FlexfecReceiveStream* receive_stream) override;
|
2016-10-23 23:37:14 -07:00
|
|
|
|
2015-03-04 12:58:35 +00:00
|
|
|
Stats GetStats() const override;
|
2013-10-28 16:32:01 +00:00
|
|
|
|
2016-10-23 23:37:14 -07:00
|
|
|
// Implements PacketReceiver.
|
2015-09-08 05:36:15 -07:00
|
|
|
DeliveryStatus DeliverPacket(MediaType media_type,
|
|
|
|
|
const uint8_t* packet,
|
|
|
|
|
size_t length,
|
|
|
|
|
const PacketTime& packet_time) override;
|
2013-10-28 16:32:01 +00:00
|
|
|
|
2016-10-18 23:50:45 -07:00
|
|
|
// Implements RecoveredPacketReceiver.
|
2017-05-11 08:00:58 -07:00
|
|
|
void OnRecoveredPacket(const uint8_t* packet, size_t length) override;
|
2016-10-18 23:50:45 -07:00
|
|
|
|
2015-03-04 12:58:35 +00:00
|
|
|
void SetBitrateConfig(
|
|
|
|
|
const webrtc::Call::Config::BitrateConfig& bitrate_config) override;
|
2016-03-22 15:32:27 -07:00
|
|
|
|
2017-06-02 14:37:37 -07:00
|
|
|
void SetBitrateConfigMask(
|
|
|
|
|
const webrtc::Call::Config::BitrateConfigMask& bitrate_config) override;
|
|
|
|
|
|
2016-03-22 15:32:27 -07:00
|
|
|
void SignalChannelNetworkState(MediaType media, NetworkState state) override;
|
2014-09-03 16:17:12 +00:00
|
|
|
|
2016-11-08 02:50:09 -08:00
|
|
|
void OnTransportOverheadChanged(MediaType media,
|
|
|
|
|
int transport_overhead_per_packet) override;
|
|
|
|
|
|
2016-04-19 15:41:36 -07:00
|
|
|
void OnNetworkRouteChanged(const std::string& transport_name,
|
|
|
|
|
const rtc::NetworkRoute& network_route) override;
|
|
|
|
|
|
2015-10-15 07:26:07 -07:00
|
|
|
void OnSentPacket(const rtc::SentPacket& sent_packet) override;
|
|
|
|
|
|
2016-11-30 04:47:39 -08:00
|
|
|
|
2015-11-12 21:02:42 -08:00
|
|
|
// Implements BitrateObserver.
|
2016-11-30 04:47:39 -08:00
|
|
|
void OnNetworkChanged(uint32_t bitrate_bps,
|
|
|
|
|
uint8_t fraction_loss,
|
|
|
|
|
int64_t rtt_ms,
|
|
|
|
|
int64_t probing_interval_ms) override;
|
2015-11-12 21:02:42 -08:00
|
|
|
|
2016-06-15 00:47:53 -07:00
|
|
|
// Implements BitrateAllocator::LimitObserver.
|
|
|
|
|
void OnAllocationLimitsChanged(uint32_t min_send_bitrate_bps,
|
|
|
|
|
uint32_t max_padding_bitrate_bps) override;
|
|
|
|
|
|
2013-10-28 16:32:01 +00:00
|
|
|
private:
|
2015-04-29 15:24:01 +02:00
|
|
|
DeliveryStatus DeliverRtcp(MediaType media_type, const uint8_t* packet,
|
|
|
|
|
size_t length);
|
2015-09-08 05:36:15 -07:00
|
|
|
DeliveryStatus DeliverRtp(MediaType media_type,
|
|
|
|
|
const uint8_t* packet,
|
|
|
|
|
size_t length,
|
|
|
|
|
const PacketTime& packet_time);
|
2015-07-15 08:02:58 -07:00
|
|
|
void ConfigureSync(const std::string& sync_group)
|
|
|
|
|
EXCLUSIVE_LOCKS_REQUIRED(receive_crit_);
|
|
|
|
|
|
2017-02-06 02:23:00 -08:00
|
|
|
void NotifyBweOfReceivedPacket(const RtpPacketReceived& packet,
|
|
|
|
|
MediaType media_type)
|
|
|
|
|
SHARED_LOCKS_REQUIRED(receive_crit_);
|
|
|
|
|
|
2017-07-11 03:56:21 -07:00
|
|
|
rtc::Optional<RtpPacketReceived> ParseRtpPacket(
|
|
|
|
|
const uint8_t* packet,
|
|
|
|
|
size_t length,
|
|
|
|
|
const PacketTime* packet_time) const;
|
2016-12-21 06:37:18 -08:00
|
|
|
|
2017-04-19 23:28:53 -07:00
|
|
|
void UpdateSendHistograms(int64_t first_sent_packet_ms)
|
|
|
|
|
EXCLUSIVE_LOCKS_REQUIRED(&bitrate_crit_);
|
2015-11-17 06:24:56 -08:00
|
|
|
void UpdateReceiveHistograms();
|
2016-07-27 00:39:09 -07:00
|
|
|
void UpdateHistograms();
|
2016-03-22 15:32:27 -07:00
|
|
|
void UpdateAggregateNetworkState();
|
2015-11-11 10:13:02 -08:00
|
|
|
|
2017-06-02 14:37:37 -07:00
|
|
|
// Applies update to the BitrateConfig cached in |config_|, restarting
|
|
|
|
|
// bandwidth estimation from |new_start| if set.
|
|
|
|
|
void UpdateCurrentBitrateConfig(const rtc::Optional<int>& new_start);
|
|
|
|
|
|
2015-12-09 11:20:58 +01:00
|
|
|
Clock* const clock_;
|
2015-11-11 10:13:02 -08:00
|
|
|
|
2015-05-08 13:54:38 +02:00
|
|
|
const int num_cpu_cores_;
|
2016-03-12 06:10:44 -08:00
|
|
|
const std::unique_ptr<ProcessThread> module_process_thread_;
|
2017-01-19 05:41:25 -08:00
|
|
|
const std::unique_ptr<ProcessThread> pacer_thread_;
|
2016-03-12 06:10:44 -08:00
|
|
|
const std::unique_ptr<CallStats> call_stats_;
|
|
|
|
|
const std::unique_ptr<BitrateAllocator> bitrate_allocator_;
|
2013-10-28 16:32:01 +00:00
|
|
|
Call::Config config_;
|
2015-10-19 03:39:20 -07:00
|
|
|
rtc::ThreadChecker configuration_thread_checker_;
|
2013-10-28 16:32:01 +00:00
|
|
|
|
2016-03-22 15:32:27 -07:00
|
|
|
NetworkState audio_network_state_;
|
|
|
|
|
NetworkState video_network_state_;
|
2014-09-03 16:17:12 +00:00
|
|
|
|
2016-03-12 06:10:44 -08:00
|
|
|
std::unique_ptr<RWLockWrapper> receive_crit_;
|
2016-10-23 23:37:14 -07:00
|
|
|
// Audio, Video, and FlexFEC receive streams are owned by the client that
|
|
|
|
|
// creates them.
|
2017-05-16 04:47:04 -07:00
|
|
|
std::set<AudioReceiveStream*> audio_receive_streams_
|
2015-04-29 15:24:01 +02:00
|
|
|
GUARDED_BY(receive_crit_);
|
|
|
|
|
std::set<VideoReceiveStream*> video_receive_streams_
|
2014-09-03 16:17:12 +00:00
|
|
|
GUARDED_BY(receive_crit_);
|
2017-05-16 04:47:04 -07:00
|
|
|
|
2015-07-15 08:02:58 -07:00
|
|
|
std::map<std::string, AudioReceiveStream*> sync_stream_mapping_
|
|
|
|
|
GUARDED_BY(receive_crit_);
|
2013-10-28 16:32:01 +00:00
|
|
|
|
2017-06-21 01:05:22 -07:00
|
|
|
// TODO(nisse): Should eventually be injected at creation,
|
|
|
|
|
// with a single object in the bundled case.
|
2017-07-03 09:25:27 -07:00
|
|
|
RtpStreamReceiverController audio_receiver_controller_;
|
|
|
|
|
RtpStreamReceiverController video_receiver_controller_;
|
2017-05-16 04:47:04 -07:00
|
|
|
|
2017-02-06 02:23:00 -08:00
|
|
|
// This extra map is used for receive processing which is
|
|
|
|
|
// independent of media type.
|
|
|
|
|
|
|
|
|
|
// TODO(nisse): In the RTP transport refactoring, we should have a
|
|
|
|
|
// single mapping from ssrc to a more abstract receive stream, with
|
|
|
|
|
// accessor methods for all configuration we need at this level.
|
|
|
|
|
struct ReceiveRtpConfig {
|
|
|
|
|
ReceiveRtpConfig() = default; // Needed by std::map
|
|
|
|
|
ReceiveRtpConfig(const std::vector<RtpExtension>& extensions,
|
2017-02-07 01:18:43 -08:00
|
|
|
bool use_send_side_bwe)
|
|
|
|
|
: extensions(extensions), use_send_side_bwe(use_send_side_bwe) {}
|
2017-02-06 02:23:00 -08:00
|
|
|
|
|
|
|
|
// Registered RTP header extensions for each stream. Note that RTP header
|
|
|
|
|
// extensions are negotiated per track ("m= line") in the SDP, but we have
|
|
|
|
|
// no notion of tracks at the Call level. We therefore store the RTP header
|
|
|
|
|
// extensions per SSRC instead, which leads to some storage overhead.
|
|
|
|
|
RtpHeaderExtensionMap extensions;
|
2017-02-07 01:18:43 -08:00
|
|
|
// Set if both RTP extension the RTCP feedback message needed for
|
|
|
|
|
// send side BWE are negotiated.
|
|
|
|
|
bool use_send_side_bwe = false;
|
2017-02-06 02:23:00 -08:00
|
|
|
};
|
|
|
|
|
std::map<uint32_t, ReceiveRtpConfig> receive_rtp_config_
|
2016-12-21 06:37:18 -08:00
|
|
|
GUARDED_BY(receive_crit_);
|
|
|
|
|
|
2016-03-12 06:10:44 -08:00
|
|
|
std::unique_ptr<RWLockWrapper> send_crit_;
|
2015-10-16 14:35:07 -07:00
|
|
|
// Audio and Video send streams are owned by the client that creates them.
|
|
|
|
|
std::map<uint32_t, AudioSendStream*> audio_send_ssrcs_ GUARDED_BY(send_crit_);
|
2015-04-29 15:24:01 +02:00
|
|
|
std::map<uint32_t, VideoSendStream*> video_send_ssrcs_ GUARDED_BY(send_crit_);
|
|
|
|
|
std::set<VideoSendStream*> video_send_streams_ GUARDED_BY(send_crit_);
|
2013-10-28 16:32:01 +00:00
|
|
|
|
2017-05-23 06:07:11 -07:00
|
|
|
using RtpStateMap = std::map<uint32_t, RtpState>;
|
|
|
|
|
RtpStateMap suspended_audio_send_ssrcs_
|
|
|
|
|
GUARDED_BY(configuration_thread_checker_);
|
|
|
|
|
RtpStateMap suspended_video_send_ssrcs_
|
|
|
|
|
GUARDED_BY(configuration_thread_checker_);
|
|
|
|
|
|
2016-10-07 11:53:05 -07:00
|
|
|
webrtc::RtcEventLog* event_log_;
|
2015-09-09 00:09:43 -07:00
|
|
|
|
2015-11-17 06:24:56 -08:00
|
|
|
// The following members are only accessed (exclusively) from one thread and
|
|
|
|
|
// from the destructor, and therefore doesn't need any explicit
|
|
|
|
|
// synchronization.
|
2016-09-08 00:07:21 -07:00
|
|
|
RateCounter received_bytes_per_second_counter_;
|
|
|
|
|
RateCounter received_audio_bytes_per_second_counter_;
|
|
|
|
|
RateCounter received_video_bytes_per_second_counter_;
|
|
|
|
|
RateCounter received_rtcp_bytes_per_second_counter_;
|
2017-07-04 04:05:06 -07:00
|
|
|
rtc::Optional<int64_t> first_received_rtp_audio_ms_;
|
|
|
|
|
rtc::Optional<int64_t> last_received_rtp_audio_ms_;
|
|
|
|
|
rtc::Optional<int64_t> first_received_rtp_video_ms_;
|
|
|
|
|
rtc::Optional<int64_t> last_received_rtp_video_ms_;
|
2017-07-19 00:39:19 -07:00
|
|
|
TimeInterval sent_rtp_audio_timer_ms_;
|
2015-11-11 10:13:02 -08:00
|
|
|
|
2015-11-17 06:24:56 -08:00
|
|
|
// TODO(holmer): Remove this lock once BitrateController no longer calls
|
|
|
|
|
// OnNetworkChanged from multiple threads.
|
|
|
|
|
rtc::CriticalSection bitrate_crit_;
|
2016-06-15 00:47:53 -07:00
|
|
|
uint32_t min_allocated_send_bitrate_bps_ GUARDED_BY(&bitrate_crit_);
|
2016-07-06 00:54:28 -07:00
|
|
|
uint32_t configured_max_padding_bitrate_bps_ GUARDED_BY(&bitrate_crit_);
|
2016-09-09 00:13:35 -07:00
|
|
|
AvgCounter estimated_send_bitrate_kbps_counter_ GUARDED_BY(&bitrate_crit_);
|
|
|
|
|
AvgCounter pacer_bitrate_kbps_counter_ GUARDED_BY(&bitrate_crit_);
|
2015-11-17 06:24:56 -08:00
|
|
|
|
2016-04-19 15:41:36 -07:00
|
|
|
std::map<std::string, rtc::NetworkRoute> network_routes_;
|
|
|
|
|
|
2017-04-06 06:34:25 -07:00
|
|
|
std::unique_ptr<RtpTransportControllerSendInterface> transport_send_;
|
2017-03-21 06:41:12 -07:00
|
|
|
ReceiveSideCongestionController receive_side_cc_;
|
2016-05-02 23:44:01 -07:00
|
|
|
const std::unique_ptr<SendDelayStats> video_send_delay_stats_;
|
2016-07-27 00:39:09 -07:00
|
|
|
const int64_t start_ms_;
|
2016-09-01 01:17:40 -07:00
|
|
|
// TODO(perkj): |worker_queue_| is supposed to replace
|
|
|
|
|
// |module_process_thread_|.
|
|
|
|
|
// |worker_queue| is defined last to ensure all pending tasks are cancelled
|
|
|
|
|
// and deleted before any other members.
|
|
|
|
|
rtc::TaskQueue worker_queue_;
|
2015-11-12 21:02:42 -08:00
|
|
|
|
2017-06-02 14:37:37 -07:00
|
|
|
// The config mask set by SetBitrateConfigMask.
|
|
|
|
|
// 0 <= min <= start <= max
|
|
|
|
|
Config::BitrateConfigMask bitrate_config_mask_;
|
|
|
|
|
|
|
|
|
|
// The config set by SetBitrateConfig.
|
|
|
|
|
// min >= 0, start != 0, max == -1 || max > 0
|
|
|
|
|
Config::BitrateConfig base_bitrate_config_;
|
|
|
|
|
|
2015-09-16 05:37:44 -07:00
|
|
|
RTC_DISALLOW_COPY_AND_ASSIGN(Call);
|
2013-10-28 16:32:01 +00:00
|
|
|
};
|
2013-12-05 12:11:47 +00:00
|
|
|
} // namespace internal
|
2013-08-14 13:52:52 +00:00
|
|
|
|
2016-08-11 08:41:18 -07:00
|
|
|
std::string Call::Stats::ToString(int64_t time_ms) const {
|
|
|
|
|
std::stringstream ss;
|
|
|
|
|
ss << "Call stats: " << time_ms << ", {";
|
|
|
|
|
ss << "send_bw_bps: " << send_bandwidth_bps << ", ";
|
|
|
|
|
ss << "recv_bw_bps: " << recv_bandwidth_bps << ", ";
|
|
|
|
|
ss << "max_pad_bps: " << max_padding_bitrate_bps << ", ";
|
|
|
|
|
ss << "pacer_delay_ms: " << pacer_delay_ms << ", ";
|
|
|
|
|
ss << "rtt_ms: " << rtt_ms;
|
|
|
|
|
ss << '}';
|
|
|
|
|
return ss.str();
|
|
|
|
|
}
|
|
|
|
|
|
2013-12-04 10:24:26 +00:00
|
|
|
Call* Call::Create(const Call::Config& config) {
|
2017-05-08 11:52:38 -07:00
|
|
|
return new internal::Call(config,
|
|
|
|
|
rtc::MakeUnique<RtpTransportControllerSend>(
|
|
|
|
|
Clock::GetRealTimeClock(), config.event_log));
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
Call* Call::Create(
|
|
|
|
|
const Call::Config& config,
|
|
|
|
|
std::unique_ptr<RtpTransportControllerSendInterface> transport_send) {
|
|
|
|
|
return new internal::Call(config, std::move(transport_send));
|
2013-08-14 13:52:52 +00:00
|
|
|
}
|
|
|
|
|
|
2013-05-16 12:08:03 +00:00
|
|
|
namespace internal {
|
|
|
|
|
|
2017-03-27 05:36:15 -07:00
|
|
|
Call::Call(const Call::Config& config,
|
2017-05-08 11:52:38 -07:00
|
|
|
std::unique_ptr<RtpTransportControllerSendInterface> transport_send)
|
2015-11-11 10:13:02 -08:00
|
|
|
: clock_(Clock::GetRealTimeClock()),
|
|
|
|
|
num_cpu_cores_(CpuInfo::DetectNumberOfCores()),
|
2016-04-26 08:18:04 -07:00
|
|
|
module_process_thread_(ProcessThread::Create("ModuleProcessThread")),
|
2017-01-19 05:41:25 -08:00
|
|
|
pacer_thread_(ProcessThread::Create("PacerThread")),
|
2015-12-09 11:20:58 +01:00
|
|
|
call_stats_(new CallStats(clock_)),
|
2016-06-15 00:47:53 -07:00
|
|
|
bitrate_allocator_(new BitrateAllocator(this)),
|
2015-05-08 13:54:38 +02:00
|
|
|
config_(config),
|
2016-11-22 16:08:30 -08:00
|
|
|
audio_network_state_(kNetworkDown),
|
|
|
|
|
video_network_state_(kNetworkDown),
|
2014-09-03 16:17:12 +00:00
|
|
|
receive_crit_(RWLockWrapper::CreateRWLock()),
|
2015-11-11 10:13:02 -08:00
|
|
|
send_crit_(RWLockWrapper::CreateRWLock()),
|
2016-10-07 11:53:05 -07:00
|
|
|
event_log_(config.event_log),
|
2016-09-08 00:07:21 -07:00
|
|
|
received_bytes_per_second_counter_(clock_, nullptr, true),
|
|
|
|
|
received_audio_bytes_per_second_counter_(clock_, nullptr, true),
|
|
|
|
|
received_video_bytes_per_second_counter_(clock_, nullptr, true),
|
|
|
|
|
received_rtcp_bytes_per_second_counter_(clock_, nullptr, true),
|
2016-06-15 00:47:53 -07:00
|
|
|
min_allocated_send_bitrate_bps_(0),
|
2016-07-06 00:54:28 -07:00
|
|
|
configured_max_padding_bitrate_bps_(0),
|
2016-09-09 00:13:35 -07:00
|
|
|
estimated_send_bitrate_kbps_counter_(clock_, nullptr, true),
|
|
|
|
|
pacer_bitrate_kbps_counter_(clock_, nullptr, true),
|
2017-04-18 23:38:35 -07:00
|
|
|
receive_side_cc_(clock_, transport_send->packet_router()),
|
2016-07-27 00:39:09 -07:00
|
|
|
video_send_delay_stats_(new SendDelayStats(clock_)),
|
2016-09-01 01:17:40 -07:00
|
|
|
start_ms_(clock_->TimeInMilliseconds()),
|
2017-06-02 14:37:37 -07:00
|
|
|
worker_queue_("call_worker_queue"),
|
|
|
|
|
base_bitrate_config_(config.bitrate_config) {
|
|
|
|
|
RTC_DCHECK(&configuration_thread_checker_);
|
2016-10-07 11:53:05 -07:00
|
|
|
RTC_DCHECK(config.event_log != nullptr);
|
2015-09-17 00:24:34 -07:00
|
|
|
RTC_DCHECK_GE(config.bitrate_config.min_bitrate_bps, 0);
|
2017-04-10 03:53:00 -07:00
|
|
|
RTC_DCHECK_GE(config.bitrate_config.start_bitrate_bps,
|
2015-09-17 00:24:34 -07:00
|
|
|
config.bitrate_config.min_bitrate_bps);
|
2015-03-26 11:11:06 +01:00
|
|
|
if (config.bitrate_config.max_bitrate_bps != -1) {
|
2015-09-17 00:24:34 -07:00
|
|
|
RTC_DCHECK_GE(config.bitrate_config.max_bitrate_bps,
|
|
|
|
|
config.bitrate_config.start_bitrate_bps);
|
2014-11-25 14:03:34 +00:00
|
|
|
}
|
2015-05-08 13:54:38 +02:00
|
|
|
Trace::CreateTrace();
|
2017-05-08 11:52:38 -07:00
|
|
|
transport_send->send_side_cc()->RegisterNetworkObserver(this);
|
2017-04-06 06:34:25 -07:00
|
|
|
transport_send_ = std::move(transport_send);
|
2017-03-27 05:36:15 -07:00
|
|
|
transport_send_->send_side_cc()->SignalNetworkState(kNetworkDown);
|
|
|
|
|
transport_send_->send_side_cc()->SetBweBitrates(
|
|
|
|
|
config_.bitrate_config.min_bitrate_bps,
|
|
|
|
|
config_.bitrate_config.start_bitrate_bps,
|
|
|
|
|
config_.bitrate_config.max_bitrate_bps);
|
2017-03-28 01:16:25 -07:00
|
|
|
call_stats_->RegisterStatsObserver(&receive_side_cc_);
|
2017-03-27 05:36:15 -07:00
|
|
|
call_stats_->RegisterStatsObserver(transport_send_->send_side_cc());
|
2016-02-24 16:02:55 +01:00
|
|
|
|
|
|
|
|
module_process_thread_->Start();
|
2017-03-03 03:20:24 -08:00
|
|
|
module_process_thread_->RegisterModule(call_stats_.get(), RTC_FROM_HERE);
|
2017-03-21 06:41:12 -07:00
|
|
|
module_process_thread_->RegisterModule(&receive_side_cc_, RTC_FROM_HERE);
|
2017-03-27 05:36:15 -07:00
|
|
|
module_process_thread_->RegisterModule(transport_send_->send_side_cc(),
|
|
|
|
|
RTC_FROM_HERE);
|
|
|
|
|
pacer_thread_->RegisterModule(transport_send_->send_side_cc()->pacer(),
|
|
|
|
|
RTC_FROM_HERE);
|
2017-01-19 05:41:25 -08:00
|
|
|
pacer_thread_->RegisterModule(
|
2017-03-21 06:41:12 -07:00
|
|
|
receive_side_cc_.GetRemoteBitrateEstimator(true), RTC_FROM_HERE);
|
2017-03-27 05:36:15 -07:00
|
|
|
|
2017-01-19 05:41:25 -08:00
|
|
|
pacer_thread_->Start();
|
2013-05-16 12:08:03 +00:00
|
|
|
}
|
|
|
|
|
|
2013-09-09 15:04:25 +00:00
|
|
|
Call::~Call() {
|
2017-05-23 06:07:11 -07:00
|
|
|
RTC_DCHECK_RUN_ON(&configuration_thread_checker_);
|
2016-09-01 01:17:40 -07:00
|
|
|
|
2015-10-16 14:35:07 -07:00
|
|
|
RTC_CHECK(audio_send_ssrcs_.empty());
|
|
|
|
|
RTC_CHECK(video_send_ssrcs_.empty());
|
|
|
|
|
RTC_CHECK(video_send_streams_.empty());
|
2017-05-16 04:47:04 -07:00
|
|
|
RTC_CHECK(audio_receive_streams_.empty());
|
2015-10-16 14:35:07 -07:00
|
|
|
RTC_CHECK(video_receive_streams_.empty());
|
2015-02-12 10:48:23 +00:00
|
|
|
|
2017-01-19 05:41:25 -08:00
|
|
|
pacer_thread_->Stop();
|
2017-03-27 05:36:15 -07:00
|
|
|
pacer_thread_->DeRegisterModule(transport_send_->send_side_cc()->pacer());
|
2017-01-19 05:41:25 -08:00
|
|
|
pacer_thread_->DeRegisterModule(
|
2017-03-21 06:41:12 -07:00
|
|
|
receive_side_cc_.GetRemoteBitrateEstimator(true));
|
2017-03-27 05:36:15 -07:00
|
|
|
module_process_thread_->DeRegisterModule(transport_send_->send_side_cc());
|
2017-03-21 06:41:12 -07:00
|
|
|
module_process_thread_->DeRegisterModule(&receive_side_cc_);
|
2015-10-21 13:24:28 +02:00
|
|
|
module_process_thread_->DeRegisterModule(call_stats_.get());
|
2015-05-08 13:54:38 +02:00
|
|
|
module_process_thread_->Stop();
|
2017-03-28 01:16:25 -07:00
|
|
|
call_stats_->DeregisterStatsObserver(&receive_side_cc_);
|
2017-03-27 05:36:15 -07:00
|
|
|
call_stats_->DeregisterStatsObserver(transport_send_->send_side_cc());
|
2016-07-13 06:37:09 -07:00
|
|
|
|
2017-04-19 23:28:53 -07:00
|
|
|
int64_t first_sent_packet_ms =
|
|
|
|
|
transport_send_->send_side_cc()->GetFirstPacketTimeMs();
|
2016-07-13 06:37:09 -07:00
|
|
|
// Only update histograms after process threads have been shut down, so that
|
|
|
|
|
// they won't try to concurrently update stats.
|
2016-09-01 01:17:40 -07:00
|
|
|
{
|
|
|
|
|
rtc::CritScope lock(&bitrate_crit_);
|
2017-04-19 23:28:53 -07:00
|
|
|
UpdateSendHistograms(first_sent_packet_ms);
|
2016-09-01 01:17:40 -07:00
|
|
|
}
|
2016-07-13 06:37:09 -07:00
|
|
|
UpdateReceiveHistograms();
|
2016-07-27 00:39:09 -07:00
|
|
|
UpdateHistograms();
|
2016-07-13 06:37:09 -07:00
|
|
|
|
2015-05-08 13:54:38 +02:00
|
|
|
Trace::ReturnTrace();
|
2013-05-16 12:08:03 +00:00
|
|
|
}
|
|
|
|
|
|
2016-12-21 06:37:18 -08:00
|
|
|
rtc::Optional<RtpPacketReceived> Call::ParseRtpPacket(
|
|
|
|
|
const uint8_t* packet,
|
|
|
|
|
size_t length,
|
2017-07-11 03:56:21 -07:00
|
|
|
const PacketTime* packet_time) const {
|
2016-12-21 06:37:18 -08:00
|
|
|
RtpPacketReceived parsed_packet;
|
|
|
|
|
if (!parsed_packet.Parse(packet, length))
|
|
|
|
|
return rtc::Optional<RtpPacketReceived>();
|
|
|
|
|
|
|
|
|
|
int64_t arrival_time_ms;
|
2017-05-11 08:00:58 -07:00
|
|
|
if (packet_time && packet_time->timestamp != -1) {
|
|
|
|
|
arrival_time_ms = (packet_time->timestamp + 500) / 1000;
|
2016-12-21 06:37:18 -08:00
|
|
|
} else {
|
|
|
|
|
arrival_time_ms = clock_->TimeInMilliseconds();
|
|
|
|
|
}
|
|
|
|
|
parsed_packet.set_arrival_time_ms(arrival_time_ms);
|
|
|
|
|
|
|
|
|
|
return rtc::Optional<RtpPacketReceived>(std::move(parsed_packet));
|
|
|
|
|
}
|
|
|
|
|
|
2016-07-27 00:39:09 -07:00
|
|
|
void Call::UpdateHistograms() {
|
2016-09-09 22:40:25 -07:00
|
|
|
RTC_HISTOGRAM_COUNTS_100000(
|
2016-07-27 00:39:09 -07:00
|
|
|
"WebRTC.Call.LifetimeInSeconds",
|
|
|
|
|
(clock_->TimeInMilliseconds() - start_ms_) / 1000);
|
|
|
|
|
}
|
|
|
|
|
|
2017-04-19 23:28:53 -07:00
|
|
|
void Call::UpdateSendHistograms(int64_t first_sent_packet_ms) {
|
|
|
|
|
if (first_sent_packet_ms == -1)
|
2015-11-17 06:24:56 -08:00
|
|
|
return;
|
2017-07-19 00:39:19 -07:00
|
|
|
if (!sent_rtp_audio_timer_ms_.Empty()) {
|
|
|
|
|
RTC_HISTOGRAM_COUNTS_100000(
|
|
|
|
|
"WebRTC.Call.TimeSendingAudioRtpPacketsInSeconds",
|
|
|
|
|
sent_rtp_audio_timer_ms_.Length() / 1000);
|
|
|
|
|
}
|
2015-11-17 06:24:56 -08:00
|
|
|
int64_t elapsed_sec =
|
2017-04-19 23:28:53 -07:00
|
|
|
(clock_->TimeInMilliseconds() - first_sent_packet_ms) / 1000;
|
2015-11-17 06:24:56 -08:00
|
|
|
if (elapsed_sec < metrics::kMinRunTimeInSeconds)
|
|
|
|
|
return;
|
2016-09-09 00:13:35 -07:00
|
|
|
const int kMinRequiredPeriodicSamples = 5;
|
|
|
|
|
AggregatedStats send_bitrate_stats =
|
|
|
|
|
estimated_send_bitrate_kbps_counter_.ProcessAndGetStats();
|
|
|
|
|
if (send_bitrate_stats.num_samples > kMinRequiredPeriodicSamples) {
|
2016-09-09 22:40:25 -07:00
|
|
|
RTC_HISTOGRAM_COUNTS_100000("WebRTC.Call.EstimatedSendBitrateInKbps",
|
|
|
|
|
send_bitrate_stats.average);
|
2016-11-15 08:20:48 -08:00
|
|
|
LOG(LS_INFO) << "WebRTC.Call.EstimatedSendBitrateInKbps, "
|
|
|
|
|
<< send_bitrate_stats.ToString();
|
2015-11-17 06:24:56 -08:00
|
|
|
}
|
2016-09-09 00:13:35 -07:00
|
|
|
AggregatedStats pacer_bitrate_stats =
|
|
|
|
|
pacer_bitrate_kbps_counter_.ProcessAndGetStats();
|
|
|
|
|
if (pacer_bitrate_stats.num_samples > kMinRequiredPeriodicSamples) {
|
2016-09-09 22:40:25 -07:00
|
|
|
RTC_HISTOGRAM_COUNTS_100000("WebRTC.Call.PacerBitrateInKbps",
|
|
|
|
|
pacer_bitrate_stats.average);
|
2016-11-15 08:20:48 -08:00
|
|
|
LOG(LS_INFO) << "WebRTC.Call.PacerBitrateInKbps, "
|
|
|
|
|
<< pacer_bitrate_stats.ToString();
|
2015-11-17 06:24:56 -08:00
|
|
|
}
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
void Call::UpdateReceiveHistograms() {
|
2017-07-04 04:05:06 -07:00
|
|
|
if (first_received_rtp_audio_ms_) {
|
|
|
|
|
RTC_HISTOGRAM_COUNTS_100000(
|
|
|
|
|
"WebRTC.Call.TimeReceivingAudioRtpPacketsInSeconds",
|
|
|
|
|
(*last_received_rtp_audio_ms_ - *first_received_rtp_audio_ms_) / 1000);
|
|
|
|
|
}
|
|
|
|
|
if (first_received_rtp_video_ms_) {
|
|
|
|
|
RTC_HISTOGRAM_COUNTS_100000(
|
|
|
|
|
"WebRTC.Call.TimeReceivingVideoRtpPacketsInSeconds",
|
|
|
|
|
(*last_received_rtp_video_ms_ - *first_received_rtp_video_ms_) / 1000);
|
|
|
|
|
}
|
2016-09-08 00:07:21 -07:00
|
|
|
const int kMinRequiredPeriodicSamples = 5;
|
|
|
|
|
AggregatedStats video_bytes_per_sec =
|
|
|
|
|
received_video_bytes_per_second_counter_.GetStats();
|
|
|
|
|
if (video_bytes_per_sec.num_samples > kMinRequiredPeriodicSamples) {
|
2016-09-09 22:40:25 -07:00
|
|
|
RTC_HISTOGRAM_COUNTS_100000("WebRTC.Call.VideoBitrateReceivedInKbps",
|
|
|
|
|
video_bytes_per_sec.average * 8 / 1000);
|
2016-11-30 05:17:16 -08:00
|
|
|
LOG(LS_INFO) << "WebRTC.Call.VideoBitrateReceivedInBps, "
|
|
|
|
|
<< video_bytes_per_sec.ToStringWithMultiplier(8);
|
2015-11-11 10:13:02 -08:00
|
|
|
}
|
2016-09-08 00:07:21 -07:00
|
|
|
AggregatedStats audio_bytes_per_sec =
|
|
|
|
|
received_audio_bytes_per_second_counter_.GetStats();
|
|
|
|
|
if (audio_bytes_per_sec.num_samples > kMinRequiredPeriodicSamples) {
|
2016-09-09 22:40:25 -07:00
|
|
|
RTC_HISTOGRAM_COUNTS_100000("WebRTC.Call.AudioBitrateReceivedInKbps",
|
|
|
|
|
audio_bytes_per_sec.average * 8 / 1000);
|
2016-11-30 05:17:16 -08:00
|
|
|
LOG(LS_INFO) << "WebRTC.Call.AudioBitrateReceivedInBps, "
|
|
|
|
|
<< audio_bytes_per_sec.ToStringWithMultiplier(8);
|
2015-11-11 10:13:02 -08:00
|
|
|
}
|
2016-09-08 00:07:21 -07:00
|
|
|
AggregatedStats rtcp_bytes_per_sec =
|
|
|
|
|
received_rtcp_bytes_per_second_counter_.GetStats();
|
|
|
|
|
if (rtcp_bytes_per_sec.num_samples > kMinRequiredPeriodicSamples) {
|
2016-09-09 22:40:25 -07:00
|
|
|
RTC_HISTOGRAM_COUNTS_100000("WebRTC.Call.RtcpBitrateReceivedInBps",
|
|
|
|
|
rtcp_bytes_per_sec.average * 8);
|
2016-11-30 05:17:16 -08:00
|
|
|
LOG(LS_INFO) << "WebRTC.Call.RtcpBitrateReceivedInBps, "
|
|
|
|
|
<< rtcp_bytes_per_sec.ToStringWithMultiplier(8);
|
2016-09-08 00:07:21 -07:00
|
|
|
}
|
|
|
|
|
AggregatedStats recv_bytes_per_sec =
|
|
|
|
|
received_bytes_per_second_counter_.GetStats();
|
|
|
|
|
if (recv_bytes_per_sec.num_samples > kMinRequiredPeriodicSamples) {
|
2016-09-09 22:40:25 -07:00
|
|
|
RTC_HISTOGRAM_COUNTS_100000("WebRTC.Call.BitrateReceivedInKbps",
|
|
|
|
|
recv_bytes_per_sec.average * 8 / 1000);
|
2016-11-30 05:17:16 -08:00
|
|
|
LOG(LS_INFO) << "WebRTC.Call.BitrateReceivedInBps, "
|
|
|
|
|
<< recv_bytes_per_sec.ToStringWithMultiplier(8);
|
2015-11-11 10:13:02 -08:00
|
|
|
}
|
|
|
|
|
}
|
|
|
|
|
|
2015-10-19 03:39:20 -07:00
|
|
|
PacketReceiver* Call::Receiver() {
|
|
|
|
|
// TODO(solenberg): Some test cases in EndToEndTest use this from a different
|
|
|
|
|
// thread. Re-enable once that is fixed.
|
2017-05-23 06:07:11 -07:00
|
|
|
// RTC_DCHECK_RUN_ON(&configuration_thread_checker_);
|
2015-10-19 03:39:20 -07:00
|
|
|
return this;
|
|
|
|
|
}
|
2013-05-16 12:08:03 +00:00
|
|
|
|
2015-06-08 13:04:56 +02:00
|
|
|
webrtc::AudioSendStream* Call::CreateAudioSendStream(
|
|
|
|
|
const webrtc::AudioSendStream::Config& config) {
|
2015-10-16 14:35:07 -07:00
|
|
|
TRACE_EVENT0("webrtc", "Call::CreateAudioSendStream");
|
2017-05-23 06:07:11 -07:00
|
|
|
RTC_DCHECK_RUN_ON(&configuration_thread_checker_);
|
2017-05-22 10:12:26 -07:00
|
|
|
event_log_->LogAudioSendStreamConfig(CreateRtcLogStreamConfig(config));
|
2017-05-23 06:07:11 -07:00
|
|
|
|
|
|
|
|
rtc::Optional<RtpState> suspended_rtp_state;
|
|
|
|
|
{
|
|
|
|
|
const auto& iter = suspended_audio_send_ssrcs_.find(config.rtp.ssrc);
|
|
|
|
|
if (iter != suspended_audio_send_ssrcs_.end()) {
|
|
|
|
|
suspended_rtp_state.emplace(iter->second);
|
|
|
|
|
}
|
|
|
|
|
}
|
|
|
|
|
|
2015-12-07 10:26:18 +01:00
|
|
|
AudioSendStream* send_stream = new AudioSendStream(
|
2017-03-27 05:36:15 -07:00
|
|
|
config, config_.audio_state, &worker_queue_, transport_send_.get(),
|
2017-05-23 06:07:11 -07:00
|
|
|
bitrate_allocator_.get(), event_log_, call_stats_->rtcp_rtt_stats(),
|
|
|
|
|
suspended_rtp_state);
|
2015-10-16 14:35:07 -07:00
|
|
|
{
|
|
|
|
|
WriteLockScoped write_lock(*send_crit_);
|
|
|
|
|
RTC_DCHECK(audio_send_ssrcs_.find(config.rtp.ssrc) ==
|
|
|
|
|
audio_send_ssrcs_.end());
|
|
|
|
|
audio_send_ssrcs_[config.rtp.ssrc] = send_stream;
|
|
|
|
|
}
|
2016-11-14 11:30:07 -08:00
|
|
|
{
|
|
|
|
|
ReadLockScoped read_lock(*receive_crit_);
|
2017-05-16 04:47:04 -07:00
|
|
|
for (AudioReceiveStream* stream : audio_receive_streams_) {
|
|
|
|
|
if (stream->config().rtp.local_ssrc == config.rtp.ssrc) {
|
|
|
|
|
stream->AssociateSendStream(send_stream);
|
2016-11-14 11:30:07 -08:00
|
|
|
}
|
|
|
|
|
}
|
|
|
|
|
}
|
2016-03-22 15:32:27 -07:00
|
|
|
send_stream->SignalNetworkState(audio_network_state_);
|
|
|
|
|
UpdateAggregateNetworkState();
|
2015-10-16 14:35:07 -07:00
|
|
|
return send_stream;
|
2015-06-08 13:04:56 +02:00
|
|
|
}
|
|
|
|
|
|
|
|
|
|
void Call::DestroyAudioSendStream(webrtc::AudioSendStream* send_stream) {
|
2015-10-16 14:35:07 -07:00
|
|
|
TRACE_EVENT0("webrtc", "Call::DestroyAudioSendStream");
|
2017-05-23 06:07:11 -07:00
|
|
|
RTC_DCHECK_RUN_ON(&configuration_thread_checker_);
|
2015-10-16 14:35:07 -07:00
|
|
|
RTC_DCHECK(send_stream != nullptr);
|
|
|
|
|
|
|
|
|
|
send_stream->Stop();
|
|
|
|
|
|
|
|
|
|
webrtc::internal::AudioSendStream* audio_send_stream =
|
|
|
|
|
static_cast<webrtc::internal::AudioSendStream*>(send_stream);
|
2017-05-23 06:07:11 -07:00
|
|
|
const uint32_t ssrc = audio_send_stream->config().rtp.ssrc;
|
|
|
|
|
suspended_audio_send_ssrcs_[ssrc] = audio_send_stream->GetRtpState();
|
2015-10-16 14:35:07 -07:00
|
|
|
{
|
|
|
|
|
WriteLockScoped write_lock(*send_crit_);
|
2016-11-14 11:30:07 -08:00
|
|
|
size_t num_deleted = audio_send_ssrcs_.erase(ssrc);
|
|
|
|
|
RTC_DCHECK_EQ(1, num_deleted);
|
|
|
|
|
}
|
|
|
|
|
{
|
|
|
|
|
ReadLockScoped read_lock(*receive_crit_);
|
2017-05-16 04:47:04 -07:00
|
|
|
for (AudioReceiveStream* stream : audio_receive_streams_) {
|
|
|
|
|
if (stream->config().rtp.local_ssrc == ssrc) {
|
|
|
|
|
stream->AssociateSendStream(nullptr);
|
2016-11-14 11:30:07 -08:00
|
|
|
}
|
|
|
|
|
}
|
2015-10-16 14:35:07 -07:00
|
|
|
}
|
2016-03-22 15:32:27 -07:00
|
|
|
UpdateAggregateNetworkState();
|
2017-07-19 00:39:19 -07:00
|
|
|
sent_rtp_audio_timer_ms_.Extend(audio_send_stream->GetActiveLifetime());
|
2015-10-16 14:35:07 -07:00
|
|
|
delete audio_send_stream;
|
2015-06-08 13:04:56 +02:00
|
|
|
}
|
|
|
|
|
|
2015-04-29 15:24:01 +02:00
|
|
|
webrtc::AudioReceiveStream* Call::CreateAudioReceiveStream(
|
|
|
|
|
const webrtc::AudioReceiveStream::Config& config) {
|
|
|
|
|
TRACE_EVENT0("webrtc", "Call::CreateAudioReceiveStream");
|
2017-05-23 06:07:11 -07:00
|
|
|
RTC_DCHECK_RUN_ON(&configuration_thread_checker_);
|
2017-05-22 09:36:28 -07:00
|
|
|
event_log_->LogAudioReceiveStreamConfig(CreateRtcLogStreamConfig(config));
|
2017-06-21 01:05:22 -07:00
|
|
|
AudioReceiveStream* receive_stream = new AudioReceiveStream(
|
2017-07-03 09:25:27 -07:00
|
|
|
&audio_receiver_controller_, transport_send_->packet_router(), config,
|
2017-06-21 01:05:22 -07:00
|
|
|
config_.audio_state, event_log_);
|
2015-04-29 15:24:01 +02:00
|
|
|
{
|
|
|
|
|
WriteLockScoped write_lock(*receive_crit_);
|
2017-02-06 02:23:00 -08:00
|
|
|
receive_rtp_config_[config.rtp.remote_ssrc] =
|
2017-02-07 01:18:43 -08:00
|
|
|
ReceiveRtpConfig(config.rtp.extensions, UseSendSideBwe(config));
|
2017-05-16 04:47:04 -07:00
|
|
|
audio_receive_streams_.insert(receive_stream);
|
2017-02-06 02:23:00 -08:00
|
|
|
|
2015-07-15 08:02:58 -07:00
|
|
|
ConfigureSync(config.sync_group);
|
2015-04-29 15:24:01 +02:00
|
|
|
}
|
2016-11-14 11:30:07 -08:00
|
|
|
{
|
|
|
|
|
ReadLockScoped read_lock(*send_crit_);
|
|
|
|
|
auto it = audio_send_ssrcs_.find(config.rtp.local_ssrc);
|
|
|
|
|
if (it != audio_send_ssrcs_.end()) {
|
|
|
|
|
receive_stream->AssociateSendStream(it->second);
|
|
|
|
|
}
|
|
|
|
|
}
|
2016-03-22 15:32:27 -07:00
|
|
|
receive_stream->SignalNetworkState(audio_network_state_);
|
|
|
|
|
UpdateAggregateNetworkState();
|
2015-04-29 15:24:01 +02:00
|
|
|
return receive_stream;
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
void Call::DestroyAudioReceiveStream(
|
|
|
|
|
webrtc::AudioReceiveStream* receive_stream) {
|
|
|
|
|
TRACE_EVENT0("webrtc", "Call::DestroyAudioReceiveStream");
|
2017-05-23 06:07:11 -07:00
|
|
|
RTC_DCHECK_RUN_ON(&configuration_thread_checker_);
|
2015-09-17 00:24:34 -07:00
|
|
|
RTC_DCHECK(receive_stream != nullptr);
|
2015-10-16 14:35:07 -07:00
|
|
|
webrtc::internal::AudioReceiveStream* audio_receive_stream =
|
|
|
|
|
static_cast<webrtc::internal::AudioReceiveStream*>(receive_stream);
|
2015-04-29 15:24:01 +02:00
|
|
|
{
|
|
|
|
|
WriteLockScoped write_lock(*receive_crit_);
|
2017-02-07 01:18:43 -08:00
|
|
|
const AudioReceiveStream::Config& config = audio_receive_stream->config();
|
|
|
|
|
uint32_t ssrc = config.rtp.remote_ssrc;
|
2017-03-21 06:41:12 -07:00
|
|
|
receive_side_cc_.GetRemoteBitrateEstimator(UseSendSideBwe(config))
|
2017-02-07 01:18:43 -08:00
|
|
|
->RemoveStream(ssrc);
|
2017-05-16 04:47:04 -07:00
|
|
|
audio_receive_streams_.erase(audio_receive_stream);
|
2015-07-15 08:02:58 -07:00
|
|
|
const std::string& sync_group = audio_receive_stream->config().sync_group;
|
|
|
|
|
const auto it = sync_stream_mapping_.find(sync_group);
|
|
|
|
|
if (it != sync_stream_mapping_.end() &&
|
|
|
|
|
it->second == audio_receive_stream) {
|
|
|
|
|
sync_stream_mapping_.erase(it);
|
|
|
|
|
ConfigureSync(sync_group);
|
|
|
|
|
}
|
2017-02-06 02:23:00 -08:00
|
|
|
receive_rtp_config_.erase(ssrc);
|
2015-04-29 15:24:01 +02:00
|
|
|
}
|
2016-03-22 15:32:27 -07:00
|
|
|
UpdateAggregateNetworkState();
|
2015-04-29 15:24:01 +02:00
|
|
|
delete audio_receive_stream;
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
webrtc::VideoSendStream* Call::CreateVideoSendStream(
|
2016-09-01 01:17:40 -07:00
|
|
|
webrtc::VideoSendStream::Config config,
|
|
|
|
|
VideoEncoderConfig encoder_config) {
|
2015-01-29 12:33:07 +00:00
|
|
|
TRACE_EVENT0("webrtc", "Call::CreateVideoSendStream");
|
2017-05-23 06:07:11 -07:00
|
|
|
RTC_DCHECK_RUN_ON(&configuration_thread_checker_);
|
2013-06-10 13:48:26 +00:00
|
|
|
|
2016-05-02 23:44:01 -07:00
|
|
|
video_send_delay_stats_->AddSsrcs(config);
|
2017-05-22 04:08:28 -07:00
|
|
|
for (size_t ssrc_index = 0; ssrc_index < config.rtp.ssrcs.size();
|
|
|
|
|
++ssrc_index) {
|
|
|
|
|
event_log_->LogVideoSendStreamConfig(
|
|
|
|
|
CreateRtcLogStreamConfig(config, ssrc_index));
|
|
|
|
|
}
|
2016-09-01 01:17:40 -07:00
|
|
|
|
2014-06-16 08:57:39 +00:00
|
|
|
// TODO(mflodman): Base the start bitrate on a current bandwidth estimate, if
|
|
|
|
|
// the call has already started.
|
2016-09-01 01:17:40 -07:00
|
|
|
// Copy ssrcs from |config| since |config| is moved.
|
|
|
|
|
std::vector<uint32_t> ssrcs = config.rtp.ssrcs;
|
2015-10-21 15:52:16 +02:00
|
|
|
VideoSendStream* send_stream = new VideoSendStream(
|
2016-09-01 01:17:40 -07:00
|
|
|
num_cpu_cores_, module_process_thread_.get(), &worker_queue_,
|
2017-03-27 05:36:15 -07:00
|
|
|
call_stats_.get(), transport_send_.get(), bitrate_allocator_.get(),
|
2017-04-18 23:38:35 -07:00
|
|
|
video_send_delay_stats_.get(), event_log_, std::move(config),
|
2017-07-11 03:44:17 -07:00
|
|
|
std::move(encoder_config), suspended_video_send_ssrcs_,
|
|
|
|
|
config_.keepalive_config);
|
2016-09-01 01:17:40 -07:00
|
|
|
|
2016-03-22 15:32:27 -07:00
|
|
|
{
|
|
|
|
|
WriteLockScoped write_lock(*send_crit_);
|
2016-09-01 01:17:40 -07:00
|
|
|
for (uint32_t ssrc : ssrcs) {
|
2016-03-22 15:32:27 -07:00
|
|
|
RTC_DCHECK(video_send_ssrcs_.find(ssrc) == video_send_ssrcs_.end());
|
|
|
|
|
video_send_ssrcs_[ssrc] = send_stream;
|
|
|
|
|
}
|
|
|
|
|
video_send_streams_.insert(send_stream);
|
2013-05-16 12:08:03 +00:00
|
|
|
}
|
2016-03-22 15:32:27 -07:00
|
|
|
send_stream->SignalNetworkState(video_network_state_);
|
|
|
|
|
UpdateAggregateNetworkState();
|
2016-09-01 01:17:40 -07:00
|
|
|
|
2013-05-16 12:08:03 +00:00
|
|
|
return send_stream;
|
|
|
|
|
}
|
|
|
|
|
|
2013-11-21 13:49:43 +00:00
|
|
|
void Call::DestroyVideoSendStream(webrtc::VideoSendStream* send_stream) {
|
2015-01-29 12:33:07 +00:00
|
|
|
TRACE_EVENT0("webrtc", "Call::DestroyVideoSendStream");
|
2015-09-17 00:24:34 -07:00
|
|
|
RTC_DCHECK(send_stream != nullptr);
|
2017-05-23 06:07:11 -07:00
|
|
|
RTC_DCHECK_RUN_ON(&configuration_thread_checker_);
|
2013-09-05 12:38:54 +00:00
|
|
|
|
2014-07-07 13:06:48 +00:00
|
|
|
send_stream->Stop();
|
|
|
|
|
|
2015-03-23 13:12:24 +00:00
|
|
|
VideoSendStream* send_stream_impl = nullptr;
|
2013-09-05 12:38:54 +00:00
|
|
|
{
|
2014-09-03 16:17:12 +00:00
|
|
|
WriteLockScoped write_lock(*send_crit_);
|
2015-04-29 15:24:01 +02:00
|
|
|
auto it = video_send_ssrcs_.begin();
|
|
|
|
|
while (it != video_send_ssrcs_.end()) {
|
2013-09-05 12:38:54 +00:00
|
|
|
if (it->second == static_cast<VideoSendStream*>(send_stream)) {
|
|
|
|
|
send_stream_impl = it->second;
|
2015-04-29 15:24:01 +02:00
|
|
|
video_send_ssrcs_.erase(it++);
|
2014-07-07 13:06:48 +00:00
|
|
|
} else {
|
|
|
|
|
++it;
|
2013-09-05 12:38:54 +00:00
|
|
|
}
|
|
|
|
|
}
|
2015-04-29 15:24:01 +02:00
|
|
|
video_send_streams_.erase(send_stream_impl);
|
2013-05-16 12:08:03 +00:00
|
|
|
}
|
2015-09-17 00:24:34 -07:00
|
|
|
RTC_CHECK(send_stream_impl != nullptr);
|
2013-09-05 12:38:54 +00:00
|
|
|
|
2016-09-01 01:17:40 -07:00
|
|
|
VideoSendStream::RtpStateMap rtp_state =
|
|
|
|
|
send_stream_impl->StopPermanentlyAndGetRtpStates();
|
2014-07-07 13:06:48 +00:00
|
|
|
|
|
|
|
|
for (VideoSendStream::RtpStateMap::iterator it = rtp_state.begin();
|
2016-09-01 01:17:40 -07:00
|
|
|
it != rtp_state.end(); ++it) {
|
2015-04-29 15:24:01 +02:00
|
|
|
suspended_video_send_ssrcs_[it->first] = it->second;
|
2014-07-07 13:06:48 +00:00
|
|
|
}
|
|
|
|
|
|
2016-03-22 15:32:27 -07:00
|
|
|
UpdateAggregateNetworkState();
|
2013-09-05 12:38:54 +00:00
|
|
|
delete send_stream_impl;
|
2013-05-16 12:08:03 +00:00
|
|
|
}
|
|
|
|
|
|
2015-04-29 15:24:01 +02:00
|
|
|
webrtc::VideoReceiveStream* Call::CreateVideoReceiveStream(
|
2016-06-10 17:58:01 +02:00
|
|
|
webrtc::VideoReceiveStream::Config configuration) {
|
2015-01-29 12:33:07 +00:00
|
|
|
TRACE_EVENT0("webrtc", "Call::CreateVideoReceiveStream");
|
2017-05-23 06:07:11 -07:00
|
|
|
RTC_DCHECK_RUN_ON(&configuration_thread_checker_);
|
2017-01-27 06:47:55 -08:00
|
|
|
|
2017-06-21 01:05:22 -07:00
|
|
|
VideoReceiveStream* receive_stream = new VideoReceiveStream(
|
2017-07-03 09:25:27 -07:00
|
|
|
&video_receiver_controller_, num_cpu_cores_,
|
2017-06-21 01:05:22 -07:00
|
|
|
transport_send_->packet_router(), std::move(configuration),
|
|
|
|
|
module_process_thread_.get(), call_stats_.get());
|
2016-06-10 17:58:01 +02:00
|
|
|
|
|
|
|
|
const webrtc::VideoReceiveStream::Config& config = receive_stream->config();
|
2017-02-06 02:23:00 -08:00
|
|
|
ReceiveRtpConfig receive_config(config.rtp.extensions,
|
2017-02-07 01:18:43 -08:00
|
|
|
UseSendSideBwe(config));
|
2016-03-22 15:32:27 -07:00
|
|
|
{
|
|
|
|
|
WriteLockScoped write_lock(*receive_crit_);
|
2017-02-06 02:23:00 -08:00
|
|
|
if (config.rtp.rtx_ssrc) {
|
|
|
|
|
// We record identical config for the rtx stream as for the main
|
2017-03-27 05:36:15 -07:00
|
|
|
// stream. Since the transport_send_cc negotiation is per payload
|
2017-02-06 02:23:00 -08:00
|
|
|
// type, we may get an incorrect value for the rtx stream, but
|
|
|
|
|
// that is unlikely to matter in practice.
|
|
|
|
|
receive_rtp_config_[config.rtp.rtx_ssrc] = receive_config;
|
|
|
|
|
}
|
|
|
|
|
receive_rtp_config_[config.rtp.remote_ssrc] = receive_config;
|
2016-03-22 15:32:27 -07:00
|
|
|
video_receive_streams_.insert(receive_stream);
|
|
|
|
|
ConfigureSync(config.sync_group);
|
|
|
|
|
}
|
|
|
|
|
receive_stream->SignalNetworkState(video_network_state_);
|
|
|
|
|
UpdateAggregateNetworkState();
|
2017-05-22 03:26:49 -07:00
|
|
|
event_log_->LogVideoReceiveStreamConfig(CreateRtcLogStreamConfig(config));
|
2013-05-16 12:08:03 +00:00
|
|
|
return receive_stream;
|
|
|
|
|
}
|
|
|
|
|
|
2013-11-21 13:49:43 +00:00
|
|
|
void Call::DestroyVideoReceiveStream(
|
|
|
|
|
webrtc::VideoReceiveStream* receive_stream) {
|
2015-01-29 12:33:07 +00:00
|
|
|
TRACE_EVENT0("webrtc", "Call::DestroyVideoReceiveStream");
|
2017-05-23 06:07:11 -07:00
|
|
|
RTC_DCHECK_RUN_ON(&configuration_thread_checker_);
|
2015-09-17 00:24:34 -07:00
|
|
|
RTC_DCHECK(receive_stream != nullptr);
|
2017-05-16 04:47:04 -07:00
|
|
|
VideoReceiveStream* receive_stream_impl =
|
|
|
|
|
static_cast<VideoReceiveStream*>(receive_stream);
|
|
|
|
|
const VideoReceiveStream::Config& config = receive_stream_impl->config();
|
2013-09-05 12:38:54 +00:00
|
|
|
{
|
2014-09-03 16:17:12 +00:00
|
|
|
WriteLockScoped write_lock(*receive_crit_);
|
2014-01-24 09:30:53 +00:00
|
|
|
// Remove all ssrcs pointing to a receive stream. As RTX retransmits on a
|
|
|
|
|
// separate SSRC there can be either one or two.
|
2017-05-16 04:47:04 -07:00
|
|
|
receive_rtp_config_.erase(config.rtp.remote_ssrc);
|
|
|
|
|
if (config.rtp.rtx_ssrc) {
|
|
|
|
|
receive_rtp_config_.erase(config.rtp.rtx_ssrc);
|
2013-09-05 12:38:54 +00:00
|
|
|
}
|
2015-04-29 15:24:01 +02:00
|
|
|
video_receive_streams_.erase(receive_stream_impl);
|
2017-05-16 04:47:04 -07:00
|
|
|
ConfigureSync(config.sync_group);
|
2013-05-16 12:08:03 +00:00
|
|
|
}
|
2017-02-07 01:18:43 -08:00
|
|
|
|
2017-03-21 06:41:12 -07:00
|
|
|
receive_side_cc_.GetRemoteBitrateEstimator(UseSendSideBwe(config))
|
2017-02-07 01:18:43 -08:00
|
|
|
->RemoveStream(config.rtp.remote_ssrc);
|
|
|
|
|
|
2016-03-22 15:32:27 -07:00
|
|
|
UpdateAggregateNetworkState();
|
2013-09-05 12:38:54 +00:00
|
|
|
delete receive_stream_impl;
|
2013-05-16 12:08:03 +00:00
|
|
|
}
|
|
|
|
|
|
2016-12-19 01:13:46 -08:00
|
|
|
FlexfecReceiveStream* Call::CreateFlexfecReceiveStream(
|
|
|
|
|
const FlexfecReceiveStream::Config& config) {
|
2016-10-23 23:37:14 -07:00
|
|
|
TRACE_EVENT0("webrtc", "Call::CreateFlexfecReceiveStream");
|
2017-05-23 06:07:11 -07:00
|
|
|
RTC_DCHECK_RUN_ON(&configuration_thread_checker_);
|
2016-12-21 06:37:18 -08:00
|
|
|
|
|
|
|
|
RecoveredPacketReceiver* recovered_packet_receiver = this;
|
2016-10-23 23:37:14 -07:00
|
|
|
|
2017-06-21 01:05:22 -07:00
|
|
|
FlexfecReceiveStreamImpl* receive_stream;
|
2016-10-23 23:37:14 -07:00
|
|
|
{
|
|
|
|
|
WriteLockScoped write_lock(*receive_crit_);
|
2017-06-21 01:05:22 -07:00
|
|
|
// Unlike the video and audio receive streams,
|
|
|
|
|
// FlexfecReceiveStream implements RtpPacketSinkInterface itself,
|
|
|
|
|
// and hence its constructor passes its |this| pointer to
|
2017-07-03 09:25:27 -07:00
|
|
|
// video_receiver_controller_->CreateStream(). Calling the
|
2017-06-21 01:05:22 -07:00
|
|
|
// constructor while holding |receive_crit_| ensures that we don't
|
|
|
|
|
// call OnRtpPacket until the constructor is finished and the
|
|
|
|
|
// object is in a valid state.
|
|
|
|
|
// TODO(nisse): Fix constructor so that it can be moved outside of
|
|
|
|
|
// this locked scope.
|
|
|
|
|
receive_stream = new FlexfecReceiveStreamImpl(
|
2017-07-03 09:25:27 -07:00
|
|
|
&video_receiver_controller_, config, recovered_packet_receiver,
|
2017-06-21 01:05:22 -07:00
|
|
|
call_stats_->rtcp_rtt_stats(), module_process_thread_.get());
|
2016-12-21 06:37:18 -08:00
|
|
|
|
2017-02-06 02:23:00 -08:00
|
|
|
RTC_DCHECK(receive_rtp_config_.find(config.remote_ssrc) ==
|
|
|
|
|
receive_rtp_config_.end());
|
|
|
|
|
receive_rtp_config_[config.remote_ssrc] =
|
2017-02-07 01:18:43 -08:00
|
|
|
ReceiveRtpConfig(config.rtp_header_extensions, UseSendSideBwe(config));
|
2016-10-23 23:37:14 -07:00
|
|
|
}
|
2016-12-21 06:37:18 -08:00
|
|
|
|
2016-10-23 23:37:14 -07:00
|
|
|
// TODO(brandtr): Store config in RtcEventLog here.
|
2016-12-21 06:37:18 -08:00
|
|
|
|
2016-10-23 23:37:14 -07:00
|
|
|
return receive_stream;
|
|
|
|
|
}
|
|
|
|
|
|
2016-12-19 01:13:46 -08:00
|
|
|
void Call::DestroyFlexfecReceiveStream(FlexfecReceiveStream* receive_stream) {
|
2016-10-23 23:37:14 -07:00
|
|
|
TRACE_EVENT0("webrtc", "Call::DestroyFlexfecReceiveStream");
|
2017-05-23 06:07:11 -07:00
|
|
|
RTC_DCHECK_RUN_ON(&configuration_thread_checker_);
|
2016-12-21 06:37:18 -08:00
|
|
|
|
2016-10-23 23:37:14 -07:00
|
|
|
RTC_DCHECK(receive_stream != nullptr);
|
2016-12-19 01:13:46 -08:00
|
|
|
// There exist no other derived classes of FlexfecReceiveStream,
|
2016-10-23 23:37:14 -07:00
|
|
|
// so this downcast is safe.
|
2016-12-19 01:13:46 -08:00
|
|
|
FlexfecReceiveStreamImpl* receive_stream_impl =
|
|
|
|
|
static_cast<FlexfecReceiveStreamImpl*>(receive_stream);
|
2016-10-23 23:37:14 -07:00
|
|
|
{
|
|
|
|
|
WriteLockScoped write_lock(*receive_crit_);
|
2016-12-21 06:37:18 -08:00
|
|
|
|
2017-02-07 01:18:43 -08:00
|
|
|
const FlexfecReceiveStream::Config& config =
|
|
|
|
|
receive_stream_impl->GetConfig();
|
|
|
|
|
uint32_t ssrc = config.remote_ssrc;
|
2017-02-06 02:23:00 -08:00
|
|
|
receive_rtp_config_.erase(ssrc);
|
2016-12-21 06:37:18 -08:00
|
|
|
|
2016-12-19 01:13:46 -08:00
|
|
|
// Remove all SSRCs pointing to the FlexfecReceiveStreamImpl to be
|
|
|
|
|
// destroyed.
|
2017-03-21 06:41:12 -07:00
|
|
|
receive_side_cc_.GetRemoteBitrateEstimator(UseSendSideBwe(config))
|
2017-02-07 01:18:43 -08:00
|
|
|
->RemoveStream(ssrc);
|
2016-10-23 23:37:14 -07:00
|
|
|
}
|
2016-12-21 06:37:18 -08:00
|
|
|
|
2016-10-23 23:37:14 -07:00
|
|
|
delete receive_stream_impl;
|
|
|
|
|
}
|
|
|
|
|
|
2014-11-05 14:05:29 +00:00
|
|
|
Call::Stats Call::GetStats() const {
|
2015-10-19 03:39:20 -07:00
|
|
|
// TODO(solenberg): Some test cases in EndToEndTest use this from a different
|
|
|
|
|
// thread. Re-enable once that is fixed.
|
2017-05-23 06:07:11 -07:00
|
|
|
// RTC_DCHECK_RUN_ON(&configuration_thread_checker_);
|
2014-11-05 14:05:29 +00:00
|
|
|
Stats stats;
|
2015-05-08 13:54:38 +02:00
|
|
|
// Fetch available send/receive bitrates.
|
2014-11-05 14:05:29 +00:00
|
|
|
uint32_t send_bandwidth = 0;
|
2017-03-27 05:36:15 -07:00
|
|
|
transport_send_->send_side_cc()->GetBitrateController()->AvailableBandwidth(
|
|
|
|
|
&send_bandwidth);
|
2015-05-08 13:54:38 +02:00
|
|
|
std::vector<unsigned int> ssrcs;
|
2014-11-05 14:05:29 +00:00
|
|
|
uint32_t recv_bandwidth = 0;
|
2017-03-21 06:41:12 -07:00
|
|
|
receive_side_cc_.GetRemoteBitrateEstimator(false)->LatestEstimate(
|
2015-10-18 22:08:19 -07:00
|
|
|
&ssrcs, &recv_bandwidth);
|
2015-05-08 13:54:38 +02:00
|
|
|
stats.send_bandwidth_bps = send_bandwidth;
|
2014-11-05 14:05:29 +00:00
|
|
|
stats.recv_bandwidth_bps = recv_bandwidth;
|
2017-03-27 05:36:15 -07:00
|
|
|
stats.pacer_delay_ms =
|
|
|
|
|
transport_send_->send_side_cc()->GetPacerQueuingDelayMs();
|
2016-02-19 09:03:26 -08:00
|
|
|
stats.rtt_ms = call_stats_->rtcp_rtt_stats()->LastProcessedRtt();
|
2016-07-06 00:54:28 -07:00
|
|
|
{
|
|
|
|
|
rtc::CritScope cs(&bitrate_crit_);
|
|
|
|
|
stats.max_padding_bitrate_bps = configured_max_padding_bitrate_bps_;
|
|
|
|
|
}
|
2014-11-05 14:05:29 +00:00
|
|
|
return stats;
|
2013-05-16 12:08:03 +00:00
|
|
|
}
|
|
|
|
|
|
2014-11-25 14:03:34 +00:00
|
|
|
void Call::SetBitrateConfig(
|
|
|
|
|
const webrtc::Call::Config::BitrateConfig& bitrate_config) {
|
2015-01-29 12:33:07 +00:00
|
|
|
TRACE_EVENT0("webrtc", "Call::SetBitrateConfig");
|
2017-05-23 06:07:11 -07:00
|
|
|
RTC_DCHECK_RUN_ON(&configuration_thread_checker_);
|
2015-09-17 00:24:34 -07:00
|
|
|
RTC_DCHECK_GE(bitrate_config.min_bitrate_bps, 0);
|
2017-06-02 14:37:37 -07:00
|
|
|
RTC_DCHECK_NE(bitrate_config.start_bitrate_bps, 0);
|
|
|
|
|
if (bitrate_config.max_bitrate_bps != -1) {
|
2015-09-17 00:24:34 -07:00
|
|
|
RTC_DCHECK_GT(bitrate_config.max_bitrate_bps, 0);
|
2017-06-02 14:37:37 -07:00
|
|
|
}
|
|
|
|
|
|
|
|
|
|
rtc::Optional<int> new_start;
|
|
|
|
|
// Only update the "start" bitrate if it's set, and different from the old
|
|
|
|
|
// value. In practice, this value comes from the x-google-start-bitrate codec
|
|
|
|
|
// parameter in SDP, and setting the same remote description twice shouldn't
|
|
|
|
|
// restart bandwidth estimation.
|
|
|
|
|
if (bitrate_config.start_bitrate_bps != -1 &&
|
|
|
|
|
bitrate_config.start_bitrate_bps !=
|
|
|
|
|
base_bitrate_config_.start_bitrate_bps) {
|
|
|
|
|
new_start.emplace(bitrate_config.start_bitrate_bps);
|
|
|
|
|
}
|
|
|
|
|
base_bitrate_config_ = bitrate_config;
|
|
|
|
|
UpdateCurrentBitrateConfig(new_start);
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
void Call::SetBitrateConfigMask(
|
|
|
|
|
const webrtc::Call::Config::BitrateConfigMask& mask) {
|
|
|
|
|
TRACE_EVENT0("webrtc", "Call::SetBitrateConfigMask");
|
|
|
|
|
RTC_DCHECK(configuration_thread_checker_.CalledOnValidThread());
|
|
|
|
|
|
|
|
|
|
bitrate_config_mask_ = mask;
|
|
|
|
|
UpdateCurrentBitrateConfig(mask.start_bitrate_bps);
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
void Call::UpdateCurrentBitrateConfig(const rtc::Optional<int>& new_start) {
|
|
|
|
|
Config::BitrateConfig updated;
|
|
|
|
|
updated.min_bitrate_bps =
|
|
|
|
|
std::max(bitrate_config_mask_.min_bitrate_bps.value_or(0),
|
|
|
|
|
base_bitrate_config_.min_bitrate_bps);
|
|
|
|
|
|
|
|
|
|
updated.max_bitrate_bps =
|
|
|
|
|
MinPositive(bitrate_config_mask_.max_bitrate_bps.value_or(-1),
|
|
|
|
|
base_bitrate_config_.max_bitrate_bps);
|
|
|
|
|
|
|
|
|
|
// If the combined min ends up greater than the combined max, the max takes
|
|
|
|
|
// priority.
|
|
|
|
|
if (updated.max_bitrate_bps != -1 &&
|
|
|
|
|
updated.min_bitrate_bps > updated.max_bitrate_bps) {
|
|
|
|
|
updated.min_bitrate_bps = updated.max_bitrate_bps;
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
// If there is nothing to update (min/max unchanged, no new bandwidth
|
|
|
|
|
// estimation start value), return early.
|
|
|
|
|
if (updated.min_bitrate_bps == config_.bitrate_config.min_bitrate_bps &&
|
|
|
|
|
updated.max_bitrate_bps == config_.bitrate_config.max_bitrate_bps &&
|
|
|
|
|
!new_start) {
|
|
|
|
|
LOG(LS_VERBOSE) << "WebRTC.Call.UpdateCurrentBitrateConfig: "
|
|
|
|
|
<< "nothing to update";
|
2014-11-25 14:03:34 +00:00
|
|
|
return;
|
|
|
|
|
}
|
2017-06-02 14:37:37 -07:00
|
|
|
|
|
|
|
|
if (new_start) {
|
|
|
|
|
// Clamp start by min and max.
|
|
|
|
|
updated.start_bitrate_bps = MinPositive(
|
|
|
|
|
std::max(*new_start, updated.min_bitrate_bps), updated.max_bitrate_bps);
|
|
|
|
|
} else {
|
|
|
|
|
updated.start_bitrate_bps = -1;
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
LOG(INFO) << "WebRTC.Call.UpdateCurrentBitrateConfig: "
|
|
|
|
|
<< "calling SetBweBitrates with args (" << updated.min_bitrate_bps
|
|
|
|
|
<< ", " << updated.start_bitrate_bps << ", "
|
|
|
|
|
<< updated.max_bitrate_bps << ")";
|
|
|
|
|
transport_send_->send_side_cc()->SetBweBitrates(updated.min_bitrate_bps,
|
|
|
|
|
updated.start_bitrate_bps,
|
|
|
|
|
updated.max_bitrate_bps);
|
|
|
|
|
if (!new_start) {
|
|
|
|
|
updated.start_bitrate_bps = config_.bitrate_config.start_bitrate_bps;
|
|
|
|
|
}
|
|
|
|
|
config_.bitrate_config = updated;
|
2014-11-25 14:03:34 +00:00
|
|
|
}
|
|
|
|
|
|
2016-03-22 15:32:27 -07:00
|
|
|
void Call::SignalChannelNetworkState(MediaType media, NetworkState state) {
|
2017-05-23 06:07:11 -07:00
|
|
|
RTC_DCHECK_RUN_ON(&configuration_thread_checker_);
|
2016-03-22 15:32:27 -07:00
|
|
|
switch (media) {
|
|
|
|
|
case MediaType::AUDIO:
|
|
|
|
|
audio_network_state_ = state;
|
|
|
|
|
break;
|
|
|
|
|
case MediaType::VIDEO:
|
|
|
|
|
video_network_state_ = state;
|
|
|
|
|
break;
|
|
|
|
|
case MediaType::ANY:
|
|
|
|
|
case MediaType::DATA:
|
|
|
|
|
RTC_NOTREACHED();
|
|
|
|
|
break;
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
UpdateAggregateNetworkState();
|
2014-09-03 16:17:12 +00:00
|
|
|
{
|
2016-03-22 15:32:27 -07:00
|
|
|
ReadLockScoped read_lock(*send_crit_);
|
2015-10-16 14:35:07 -07:00
|
|
|
for (auto& kv : audio_send_ssrcs_) {
|
2016-03-22 15:32:27 -07:00
|
|
|
kv.second->SignalNetworkState(audio_network_state_);
|
2015-10-16 14:35:07 -07:00
|
|
|
}
|
2015-04-29 15:24:01 +02:00
|
|
|
for (auto& kv : video_send_ssrcs_) {
|
2016-03-22 15:32:27 -07:00
|
|
|
kv.second->SignalNetworkState(video_network_state_);
|
2014-09-03 16:17:12 +00:00
|
|
|
}
|
|
|
|
|
}
|
|
|
|
|
{
|
2016-03-22 15:32:27 -07:00
|
|
|
ReadLockScoped read_lock(*receive_crit_);
|
2017-05-16 04:47:04 -07:00
|
|
|
for (AudioReceiveStream* audio_receive_stream : audio_receive_streams_) {
|
|
|
|
|
audio_receive_stream->SignalNetworkState(audio_network_state_);
|
2016-03-22 15:32:27 -07:00
|
|
|
}
|
2017-05-16 04:47:04 -07:00
|
|
|
for (VideoReceiveStream* video_receive_stream : video_receive_streams_) {
|
|
|
|
|
video_receive_stream->SignalNetworkState(video_network_state_);
|
2014-09-03 16:17:12 +00:00
|
|
|
}
|
|
|
|
|
}
|
|
|
|
|
}
|
|
|
|
|
|
2016-11-08 02:50:09 -08:00
|
|
|
void Call::OnTransportOverheadChanged(MediaType media,
|
|
|
|
|
int transport_overhead_per_packet) {
|
|
|
|
|
switch (media) {
|
|
|
|
|
case MediaType::AUDIO: {
|
|
|
|
|
ReadLockScoped read_lock(*send_crit_);
|
|
|
|
|
for (auto& kv : audio_send_ssrcs_) {
|
|
|
|
|
kv.second->SetTransportOverhead(transport_overhead_per_packet);
|
|
|
|
|
}
|
|
|
|
|
break;
|
|
|
|
|
}
|
|
|
|
|
case MediaType::VIDEO: {
|
|
|
|
|
ReadLockScoped read_lock(*send_crit_);
|
|
|
|
|
for (auto& kv : video_send_ssrcs_) {
|
|
|
|
|
kv.second->SetTransportOverhead(transport_overhead_per_packet);
|
|
|
|
|
}
|
|
|
|
|
break;
|
|
|
|
|
}
|
|
|
|
|
case MediaType::ANY:
|
|
|
|
|
case MediaType::DATA:
|
|
|
|
|
RTC_NOTREACHED();
|
|
|
|
|
break;
|
|
|
|
|
}
|
|
|
|
|
}
|
|
|
|
|
|
2016-04-19 15:41:36 -07:00
|
|
|
// TODO(honghaiz): Add tests for this method.
|
|
|
|
|
void Call::OnNetworkRouteChanged(const std::string& transport_name,
|
|
|
|
|
const rtc::NetworkRoute& network_route) {
|
2017-05-23 06:07:11 -07:00
|
|
|
RTC_DCHECK_RUN_ON(&configuration_thread_checker_);
|
2016-04-19 15:41:36 -07:00
|
|
|
// Check if the network route is connected.
|
|
|
|
|
if (!network_route.connected) {
|
|
|
|
|
LOG(LS_INFO) << "Transport " << transport_name << " is disconnected";
|
|
|
|
|
// TODO(honghaiz): Perhaps handle this in SignalChannelNetworkState and
|
|
|
|
|
// consider merging these two methods.
|
|
|
|
|
return;
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
// Check whether the network route has changed on each transport.
|
|
|
|
|
auto result =
|
|
|
|
|
network_routes_.insert(std::make_pair(transport_name, network_route));
|
|
|
|
|
auto kv = result.first;
|
|
|
|
|
bool inserted = result.second;
|
|
|
|
|
if (inserted) {
|
|
|
|
|
// No need to reset BWE if this is the first time the network connects.
|
|
|
|
|
return;
|
|
|
|
|
}
|
|
|
|
|
if (kv->second != network_route) {
|
|
|
|
|
kv->second = network_route;
|
|
|
|
|
LOG(LS_INFO) << "Network route changed on transport " << transport_name
|
|
|
|
|
<< ": new local network id " << network_route.local_network_id
|
2016-06-24 11:03:55 -07:00
|
|
|
<< " new remote network id " << network_route.remote_network_id
|
2016-09-20 14:14:23 +02:00
|
|
|
<< " Reset bitrates to min: "
|
|
|
|
|
<< config_.bitrate_config.min_bitrate_bps
|
|
|
|
|
<< " bps, start: " << config_.bitrate_config.start_bitrate_bps
|
|
|
|
|
<< " bps, max: " << config_.bitrate_config.start_bitrate_bps
|
|
|
|
|
<< " bps.";
|
2017-01-27 06:43:18 -08:00
|
|
|
RTC_DCHECK_GT(config_.bitrate_config.start_bitrate_bps, 0);
|
2017-03-27 05:36:15 -07:00
|
|
|
transport_send_->send_side_cc()->OnNetworkRouteChanged(
|
2017-03-15 12:40:25 +01:00
|
|
|
network_route, config_.bitrate_config.start_bitrate_bps,
|
2016-06-24 11:03:55 -07:00
|
|
|
config_.bitrate_config.min_bitrate_bps,
|
|
|
|
|
config_.bitrate_config.max_bitrate_bps);
|
2016-04-19 15:41:36 -07:00
|
|
|
}
|
|
|
|
|
}
|
|
|
|
|
|
2016-03-22 15:32:27 -07:00
|
|
|
void Call::UpdateAggregateNetworkState() {
|
2017-05-23 06:07:11 -07:00
|
|
|
RTC_DCHECK_RUN_ON(&configuration_thread_checker_);
|
2016-03-22 15:32:27 -07:00
|
|
|
|
|
|
|
|
bool have_audio = false;
|
|
|
|
|
bool have_video = false;
|
|
|
|
|
{
|
|
|
|
|
ReadLockScoped read_lock(*send_crit_);
|
|
|
|
|
if (audio_send_ssrcs_.size() > 0)
|
|
|
|
|
have_audio = true;
|
|
|
|
|
if (video_send_ssrcs_.size() > 0)
|
|
|
|
|
have_video = true;
|
|
|
|
|
}
|
|
|
|
|
{
|
|
|
|
|
ReadLockScoped read_lock(*receive_crit_);
|
2017-05-16 04:47:04 -07:00
|
|
|
if (audio_receive_streams_.size() > 0)
|
2016-03-22 15:32:27 -07:00
|
|
|
have_audio = true;
|
2017-05-16 04:47:04 -07:00
|
|
|
if (video_receive_streams_.size() > 0)
|
2016-03-22 15:32:27 -07:00
|
|
|
have_video = true;
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
NetworkState aggregate_state = kNetworkDown;
|
|
|
|
|
if ((have_video && video_network_state_ == kNetworkUp) ||
|
|
|
|
|
(have_audio && audio_network_state_ == kNetworkUp)) {
|
|
|
|
|
aggregate_state = kNetworkUp;
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
LOG(LS_INFO) << "UpdateAggregateNetworkState: aggregate_state="
|
|
|
|
|
<< (aggregate_state == kNetworkUp ? "up" : "down");
|
|
|
|
|
|
2017-03-27 05:36:15 -07:00
|
|
|
transport_send_->send_side_cc()->SignalNetworkState(aggregate_state);
|
2016-03-22 15:32:27 -07:00
|
|
|
}
|
|
|
|
|
|
2015-10-15 07:26:07 -07:00
|
|
|
void Call::OnSentPacket(const rtc::SentPacket& sent_packet) {
|
2016-05-02 23:44:01 -07:00
|
|
|
video_send_delay_stats_->OnSentPacket(sent_packet.packet_id,
|
|
|
|
|
clock_->TimeInMilliseconds());
|
2017-03-27 05:36:15 -07:00
|
|
|
transport_send_->send_side_cc()->OnSentPacket(sent_packet);
|
2015-10-15 07:26:07 -07:00
|
|
|
}
|
|
|
|
|
|
2016-11-30 04:47:39 -08:00
|
|
|
void Call::OnNetworkChanged(uint32_t target_bitrate_bps,
|
|
|
|
|
uint8_t fraction_loss,
|
|
|
|
|
int64_t rtt_ms,
|
|
|
|
|
int64_t probing_interval_ms) {
|
2016-09-01 01:17:40 -07:00
|
|
|
// TODO(perkj): Consider making sure CongestionController operates on
|
|
|
|
|
// |worker_queue_|.
|
|
|
|
|
if (!worker_queue_.IsCurrent()) {
|
2016-11-30 04:47:39 -08:00
|
|
|
worker_queue_.PostTask(
|
|
|
|
|
[this, target_bitrate_bps, fraction_loss, rtt_ms, probing_interval_ms] {
|
|
|
|
|
OnNetworkChanged(target_bitrate_bps, fraction_loss, rtt_ms,
|
|
|
|
|
probing_interval_ms);
|
|
|
|
|
});
|
2016-09-01 01:17:40 -07:00
|
|
|
return;
|
|
|
|
|
}
|
|
|
|
|
RTC_DCHECK_RUN_ON(&worker_queue_);
|
2017-03-21 06:41:12 -07:00
|
|
|
// For controlling the rate of feedback messages.
|
|
|
|
|
receive_side_cc_.OnBitrateChanged(target_bitrate_bps);
|
2016-06-15 00:47:53 -07:00
|
|
|
bitrate_allocator_->OnNetworkChanged(target_bitrate_bps, fraction_loss,
|
2016-11-30 04:47:39 -08:00
|
|
|
rtt_ms, probing_interval_ms);
|
2015-11-12 21:02:42 -08:00
|
|
|
|
2016-09-09 00:13:35 -07:00
|
|
|
// Ignore updates if bitrate is zero (the aggregate network state is down).
|
|
|
|
|
if (target_bitrate_bps == 0) {
|
2015-11-17 06:24:56 -08:00
|
|
|
rtc::CritScope lock(&bitrate_crit_);
|
2016-09-09 00:13:35 -07:00
|
|
|
estimated_send_bitrate_kbps_counter_.ProcessAndPause();
|
|
|
|
|
pacer_bitrate_kbps_counter_.ProcessAndPause();
|
|
|
|
|
return;
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
bool sending_video;
|
|
|
|
|
{
|
|
|
|
|
ReadLockScoped read_lock(*send_crit_);
|
|
|
|
|
sending_video = !video_send_streams_.empty();
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
rtc::CritScope lock(&bitrate_crit_);
|
|
|
|
|
if (!sending_video) {
|
|
|
|
|
// Do not update the stats if we are not sending video.
|
|
|
|
|
estimated_send_bitrate_kbps_counter_.ProcessAndPause();
|
|
|
|
|
pacer_bitrate_kbps_counter_.ProcessAndPause();
|
|
|
|
|
return;
|
2015-11-17 06:24:56 -08:00
|
|
|
}
|
2016-09-09 00:13:35 -07:00
|
|
|
estimated_send_bitrate_kbps_counter_.Add(target_bitrate_bps / 1000);
|
|
|
|
|
// Pacer bitrate may be higher than bitrate estimate if enforcing min bitrate.
|
|
|
|
|
uint32_t pacer_bitrate_bps =
|
|
|
|
|
std::max(target_bitrate_bps, min_allocated_send_bitrate_bps_);
|
|
|
|
|
pacer_bitrate_kbps_counter_.Add(pacer_bitrate_bps / 1000);
|
2016-06-15 00:47:53 -07:00
|
|
|
}
|
2016-06-09 17:21:19 +02:00
|
|
|
|
2016-06-15 00:47:53 -07:00
|
|
|
void Call::OnAllocationLimitsChanged(uint32_t min_send_bitrate_bps,
|
|
|
|
|
uint32_t max_padding_bitrate_bps) {
|
2017-03-27 05:36:15 -07:00
|
|
|
transport_send_->send_side_cc()->SetAllocatedSendBitrateLimits(
|
|
|
|
|
min_send_bitrate_bps, max_padding_bitrate_bps);
|
2016-06-15 00:47:53 -07:00
|
|
|
rtc::CritScope lock(&bitrate_crit_);
|
|
|
|
|
min_allocated_send_bitrate_bps_ = min_send_bitrate_bps;
|
2016-07-06 00:54:28 -07:00
|
|
|
configured_max_padding_bitrate_bps_ = max_padding_bitrate_bps;
|
2015-11-12 21:02:42 -08:00
|
|
|
}
|
|
|
|
|
|
2015-07-15 08:02:58 -07:00
|
|
|
void Call::ConfigureSync(const std::string& sync_group) {
|
|
|
|
|
// Set sync only if there was no previous one.
|
2017-01-31 03:58:40 -08:00
|
|
|
if (sync_group.empty())
|
2015-07-15 08:02:58 -07:00
|
|
|
return;
|
|
|
|
|
|
|
|
|
|
AudioReceiveStream* sync_audio_stream = nullptr;
|
|
|
|
|
// Find existing audio stream.
|
|
|
|
|
const auto it = sync_stream_mapping_.find(sync_group);
|
|
|
|
|
if (it != sync_stream_mapping_.end()) {
|
|
|
|
|
sync_audio_stream = it->second;
|
|
|
|
|
} else {
|
|
|
|
|
// No configured audio stream, see if we can find one.
|
2017-05-16 04:47:04 -07:00
|
|
|
for (AudioReceiveStream* stream : audio_receive_streams_) {
|
|
|
|
|
if (stream->config().sync_group == sync_group) {
|
2015-07-15 08:02:58 -07:00
|
|
|
if (sync_audio_stream != nullptr) {
|
|
|
|
|
LOG(LS_WARNING) << "Attempting to sync more than one audio stream "
|
|
|
|
|
"within the same sync group. This is not "
|
|
|
|
|
"supported in the current implementation.";
|
|
|
|
|
break;
|
|
|
|
|
}
|
2017-05-16 04:47:04 -07:00
|
|
|
sync_audio_stream = stream;
|
2015-07-15 08:02:58 -07:00
|
|
|
}
|
|
|
|
|
}
|
|
|
|
|
}
|
|
|
|
|
if (sync_audio_stream)
|
|
|
|
|
sync_stream_mapping_[sync_group] = sync_audio_stream;
|
|
|
|
|
size_t num_synced_streams = 0;
|
|
|
|
|
for (VideoReceiveStream* video_stream : video_receive_streams_) {
|
|
|
|
|
if (video_stream->config().sync_group != sync_group)
|
|
|
|
|
continue;
|
|
|
|
|
++num_synced_streams;
|
|
|
|
|
if (num_synced_streams > 1) {
|
|
|
|
|
// TODO(pbos): Support synchronizing more than one A/V pair.
|
|
|
|
|
// https://code.google.com/p/webrtc/issues/detail?id=4762
|
|
|
|
|
LOG(LS_WARNING) << "Attempting to sync more than one audio/video pair "
|
|
|
|
|
"within the same sync group. This is not supported in "
|
|
|
|
|
"the current implementation.";
|
|
|
|
|
}
|
|
|
|
|
// Only sync the first A/V pair within this sync group.
|
2017-01-31 03:58:40 -08:00
|
|
|
if (num_synced_streams == 1) {
|
|
|
|
|
// sync_audio_stream may be null and that's ok.
|
|
|
|
|
video_stream->SetSync(sync_audio_stream);
|
2015-07-15 08:02:58 -07:00
|
|
|
} else {
|
2017-01-31 03:58:40 -08:00
|
|
|
video_stream->SetSync(nullptr);
|
2015-07-15 08:02:58 -07:00
|
|
|
}
|
|
|
|
|
}
|
|
|
|
|
}
|
|
|
|
|
|
2015-04-29 15:24:01 +02:00
|
|
|
PacketReceiver::DeliveryStatus Call::DeliverRtcp(MediaType media_type,
|
|
|
|
|
const uint8_t* packet,
|
|
|
|
|
size_t length) {
|
2015-12-07 23:17:15 +01:00
|
|
|
TRACE_EVENT0("webrtc", "Call::DeliverRtcp");
|
2016-04-29 00:57:13 -07:00
|
|
|
// TODO(pbos): Make sure it's a valid packet.
|
2014-05-14 13:57:12 +00:00
|
|
|
// Return DELIVERY_UNKNOWN_SSRC if it can be determined that
|
|
|
|
|
// there's no receiver of the packet.
|
2016-09-08 00:07:21 -07:00
|
|
|
if (received_bytes_per_second_counter_.HasSample()) {
|
|
|
|
|
// First RTP packet has been received.
|
|
|
|
|
received_bytes_per_second_counter_.Add(static_cast<int>(length));
|
|
|
|
|
received_rtcp_bytes_per_second_counter_.Add(static_cast<int>(length));
|
|
|
|
|
}
|
2013-05-16 12:08:03 +00:00
|
|
|
bool rtcp_delivered = false;
|
2015-04-29 15:24:01 +02:00
|
|
|
if (media_type == MediaType::ANY || media_type == MediaType::VIDEO) {
|
2014-09-03 16:17:12 +00:00
|
|
|
ReadLockScoped read_lock(*receive_crit_);
|
2015-04-29 15:24:01 +02:00
|
|
|
for (VideoReceiveStream* stream : video_receive_streams_) {
|
2016-04-29 00:57:13 -07:00
|
|
|
if (stream->DeliverRtcp(packet, length))
|
|
|
|
|
rtcp_delivered = true;
|
|
|
|
|
}
|
|
|
|
|
}
|
|
|
|
|
if (media_type == MediaType::ANY || media_type == MediaType::AUDIO) {
|
|
|
|
|
ReadLockScoped read_lock(*receive_crit_);
|
2017-05-16 04:47:04 -07:00
|
|
|
for (AudioReceiveStream* stream : audio_receive_streams_) {
|
|
|
|
|
if (stream->DeliverRtcp(packet, length))
|
2013-08-05 12:49:22 +00:00
|
|
|
rtcp_delivered = true;
|
2013-08-05 12:01:36 +00:00
|
|
|
}
|
|
|
|
|
}
|
2015-04-29 15:24:01 +02:00
|
|
|
if (media_type == MediaType::ANY || media_type == MediaType::VIDEO) {
|
2014-09-03 16:17:12 +00:00
|
|
|
ReadLockScoped read_lock(*send_crit_);
|
2015-04-29 15:24:01 +02:00
|
|
|
for (VideoSendStream* stream : video_send_streams_) {
|
2016-04-29 00:57:13 -07:00
|
|
|
if (stream->DeliverRtcp(packet, length))
|
2013-08-05 12:49:22 +00:00
|
|
|
rtcp_delivered = true;
|
2013-05-16 12:08:03 +00:00
|
|
|
}
|
|
|
|
|
}
|
2016-04-29 00:57:13 -07:00
|
|
|
if (media_type == MediaType::ANY || media_type == MediaType::AUDIO) {
|
|
|
|
|
ReadLockScoped read_lock(*send_crit_);
|
|
|
|
|
for (auto& kv : audio_send_ssrcs_) {
|
|
|
|
|
if (kv.second->DeliverRtcp(packet, length))
|
|
|
|
|
rtcp_delivered = true;
|
|
|
|
|
}
|
|
|
|
|
}
|
|
|
|
|
|
2016-10-07 11:53:05 -07:00
|
|
|
if (rtcp_delivered)
|
2017-05-30 03:52:10 -07:00
|
|
|
event_log_->LogRtcpPacket(kIncomingPacket, packet, length);
|
2016-04-29 00:57:13 -07:00
|
|
|
|
2014-05-14 13:57:12 +00:00
|
|
|
return rtcp_delivered ? DELIVERY_OK : DELIVERY_PACKET_ERROR;
|
2013-05-16 12:08:03 +00:00
|
|
|
}
|
|
|
|
|
|
2015-04-29 15:24:01 +02:00
|
|
|
PacketReceiver::DeliveryStatus Call::DeliverRtp(MediaType media_type,
|
|
|
|
|
const uint8_t* packet,
|
2015-09-08 05:36:15 -07:00
|
|
|
size_t length,
|
|
|
|
|
const PacketTime& packet_time) {
|
2015-12-07 23:17:15 +01:00
|
|
|
TRACE_EVENT0("webrtc", "Call::DeliverRtp");
|
2017-02-01 03:06:58 -08:00
|
|
|
|
2017-02-06 02:23:00 -08:00
|
|
|
// TODO(nisse): We should parse the RTP header only here, and pass
|
|
|
|
|
// on parsed_packet to the receive streams.
|
|
|
|
|
rtc::Optional<RtpPacketReceived> parsed_packet =
|
2017-05-11 08:00:58 -07:00
|
|
|
ParseRtpPacket(packet, length, &packet_time);
|
2017-02-06 02:23:00 -08:00
|
|
|
|
2017-07-11 03:56:21 -07:00
|
|
|
// We might get RTP keep-alive packets in accordance with RFC6263 section 4.6.
|
|
|
|
|
// These are empty (zero length payload) RTP packets with an unsignaled
|
|
|
|
|
// payload type.
|
|
|
|
|
const bool is_keep_alive_packet =
|
|
|
|
|
parsed_packet && parsed_packet->payload_size() == 0;
|
|
|
|
|
|
|
|
|
|
RTC_DCHECK(media_type == MediaType::AUDIO || media_type == MediaType::VIDEO ||
|
|
|
|
|
is_keep_alive_packet);
|
|
|
|
|
|
2017-02-06 02:23:00 -08:00
|
|
|
if (!parsed_packet)
|
|
|
|
|
return DELIVERY_PACKET_ERROR;
|
|
|
|
|
|
2017-07-11 03:56:21 -07:00
|
|
|
ReadLockScoped read_lock(*receive_crit_);
|
2017-06-21 01:05:22 -07:00
|
|
|
auto it = receive_rtp_config_.find(parsed_packet->Ssrc());
|
|
|
|
|
if (it == receive_rtp_config_.end()) {
|
|
|
|
|
LOG(LS_ERROR) << "receive_rtp_config_ lookup failed for ssrc "
|
|
|
|
|
<< parsed_packet->Ssrc();
|
|
|
|
|
// Destruction of the receive stream, including deregistering from the
|
|
|
|
|
// RtpDemuxer, is not protected by the |receive_crit_| lock. But
|
|
|
|
|
// deregistering in the |receive_rtp_config_| map is protected by that lock.
|
|
|
|
|
// So by not passing the packet on to demuxing in this case, we prevent
|
|
|
|
|
// incoming packets to be passed on via the demuxer to a receive stream
|
|
|
|
|
// which is being torned down.
|
|
|
|
|
return DELIVERY_UNKNOWN_SSRC;
|
|
|
|
|
}
|
|
|
|
|
parsed_packet->IdentifyExtensions(it->second.extensions);
|
|
|
|
|
|
2017-02-06 02:23:00 -08:00
|
|
|
NotifyBweOfReceivedPacket(*parsed_packet, media_type);
|
|
|
|
|
|
Reland of Don't hardcode MediaType::ANY in FakeNetworkPipe. (patchset #1 id:1 of https://codereview.webrtc.org/2784543002/ )
Reason for revert:
Intend to fix perf failures and reland.
Original issue's description:
> Revert of Don't hardcode MediaType::ANY in FakeNetworkPipe. (patchset #4 id:60001 of https://codereview.webrtc.org/2774463003/ )
>
> Reason for revert:
> Reverting since this seems to break multiple WebRTC Perf buildbots
>
> Original issue's description:
> > Don't hardcode MediaType::ANY in FakeNetworkPipe.
> >
> > Instead let each test set the appropriate media type. This simplifies
> > demuxing in Call and later in RtpTransportController.
> >
> > BUG=webrtc:7135
> >
> > Review-Url: https://codereview.webrtc.org/2774463003
> > Cr-Commit-Position: refs/heads/master@{#17418}
> > Committed: https://chromium.googlesource.com/external/webrtc/+/9c47b00e24da2941eb095df5a4459c6d98a8a88d
>
> TBR=stefan@webrtc.org,deadbeef@webrtc.org,solenberg@webrtc.org,pbos@webrtc.org,sprang@webrtc.org,nisse@webrtc.org
> # Skipping CQ checks because original CL landed less than 1 days ago.
> NOPRESUBMIT=true
> NOTREECHECKS=true
> NOTRY=true
> BUG=webrtc:7135
>
> Review-Url: https://codereview.webrtc.org/2784543002
> Cr-Commit-Position: refs/heads/master@{#17427}
> Committed: https://chromium.googlesource.com/external/webrtc/+/3a3bd5061089da5327fc549337a8430054d66057
TBR=stefan@webrtc.org,deadbeef@webrtc.org,solenberg@webrtc.org,pbos@webrtc.org,sprang@webrtc.org,lliuu@webrtc.org
# Skipping CQ checks because original CL landed less than 1 days ago.
NOPRESUBMIT=true
NOTREECHECKS=true
NOTRY=true
BUG=webrtc:7135
Review-Url: https://codereview.webrtc.org/2783853002
Cr-Commit-Position: refs/heads/master@{#17459}
2017-03-29 23:57:43 -07:00
|
|
|
if (media_type == MediaType::AUDIO) {
|
2017-07-03 09:25:27 -07:00
|
|
|
if (audio_receiver_controller_.OnRtpPacket(*parsed_packet)) {
|
2016-09-08 00:07:21 -07:00
|
|
|
received_bytes_per_second_counter_.Add(static_cast<int>(length));
|
|
|
|
|
received_audio_bytes_per_second_counter_.Add(static_cast<int>(length));
|
2017-05-30 03:52:10 -07:00
|
|
|
event_log_->LogRtpHeader(kIncomingPacket, packet, length);
|
2017-07-04 04:05:06 -07:00
|
|
|
const int64_t arrival_time_ms = parsed_packet->arrival_time_ms();
|
|
|
|
|
if (!first_received_rtp_audio_ms_) {
|
|
|
|
|
first_received_rtp_audio_ms_.emplace(arrival_time_ms);
|
|
|
|
|
}
|
|
|
|
|
last_received_rtp_audio_ms_.emplace(arrival_time_ms);
|
2017-02-21 06:28:10 -08:00
|
|
|
return DELIVERY_OK;
|
2015-04-29 15:24:01 +02:00
|
|
|
}
|
2017-05-16 04:47:04 -07:00
|
|
|
} else if (media_type == MediaType::VIDEO) {
|
2017-07-03 09:25:27 -07:00
|
|
|
if (video_receiver_controller_.OnRtpPacket(*parsed_packet)) {
|
2016-09-08 00:07:21 -07:00
|
|
|
received_bytes_per_second_counter_.Add(static_cast<int>(length));
|
|
|
|
|
received_video_bytes_per_second_counter_.Add(static_cast<int>(length));
|
2017-05-30 03:52:10 -07:00
|
|
|
event_log_->LogRtpHeader(kIncomingPacket, packet, length);
|
2017-07-04 04:05:06 -07:00
|
|
|
const int64_t arrival_time_ms = parsed_packet->arrival_time_ms();
|
|
|
|
|
if (!first_received_rtp_video_ms_) {
|
|
|
|
|
first_received_rtp_video_ms_.emplace(arrival_time_ms);
|
|
|
|
|
}
|
|
|
|
|
last_received_rtp_video_ms_.emplace(arrival_time_ms);
|
2017-02-16 06:52:32 -08:00
|
|
|
return DELIVERY_OK;
|
2015-04-29 15:24:01 +02:00
|
|
|
}
|
|
|
|
|
}
|
|
|
|
|
return DELIVERY_UNKNOWN_SSRC;
|
2013-05-16 12:08:03 +00:00
|
|
|
}
|
|
|
|
|
|
2015-09-08 05:36:15 -07:00
|
|
|
PacketReceiver::DeliveryStatus Call::DeliverPacket(
|
|
|
|
|
MediaType media_type,
|
|
|
|
|
const uint8_t* packet,
|
|
|
|
|
size_t length,
|
|
|
|
|
const PacketTime& packet_time) {
|
2015-10-19 03:39:20 -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.
|
|
|
|
|
// RTC_DCHECK(!configuration_thread_checker_.CalledOnValidThread());
|
2014-07-08 12:10:51 +00:00
|
|
|
if (RtpHeaderParser::IsRtcp(packet, length))
|
2015-04-29 15:24:01 +02:00
|
|
|
return DeliverRtcp(media_type, packet, length);
|
2013-05-16 12:08:03 +00:00
|
|
|
|
2015-09-08 05:36:15 -07:00
|
|
|
return DeliverRtp(media_type, packet, length, packet_time);
|
2013-05-16 12:08:03 +00:00
|
|
|
}
|
|
|
|
|
|
2016-10-18 23:50:45 -07:00
|
|
|
// TODO(brandtr): Update this member function when we support protecting
|
|
|
|
|
// audio packets with FlexFEC.
|
2017-05-11 08:00:58 -07:00
|
|
|
void Call::OnRecoveredPacket(const uint8_t* packet, size_t length) {
|
2016-10-18 23:50:45 -07:00
|
|
|
ReadLockScoped read_lock(*receive_crit_);
|
2017-05-11 08:00:58 -07:00
|
|
|
rtc::Optional<RtpPacketReceived> parsed_packet =
|
|
|
|
|
ParseRtpPacket(packet, length, nullptr);
|
|
|
|
|
if (!parsed_packet)
|
|
|
|
|
return;
|
|
|
|
|
|
|
|
|
|
parsed_packet->set_recovered(true);
|
|
|
|
|
|
2017-07-03 09:25:27 -07:00
|
|
|
video_receiver_controller_.OnRtpPacket(*parsed_packet);
|
2016-10-18 23:50:45 -07:00
|
|
|
}
|
|
|
|
|
|
2017-02-06 02:23:00 -08:00
|
|
|
void Call::NotifyBweOfReceivedPacket(const RtpPacketReceived& packet,
|
|
|
|
|
MediaType media_type) {
|
|
|
|
|
auto it = receive_rtp_config_.find(packet.Ssrc());
|
2017-02-07 01:18:43 -08:00
|
|
|
bool use_send_side_bwe =
|
|
|
|
|
(it != receive_rtp_config_.end()) && it->second.use_send_side_bwe;
|
2017-02-06 02:23:00 -08:00
|
|
|
|
2016-12-21 06:37:18 -08:00
|
|
|
RTPHeader header;
|
|
|
|
|
packet.GetHeader(&header);
|
2017-02-06 02:23:00 -08:00
|
|
|
|
2017-02-07 01:18:43 -08:00
|
|
|
if (!use_send_side_bwe && header.extension.hasTransportSequenceNumber) {
|
2017-02-06 02:23:00 -08:00
|
|
|
// Inconsistent configuration of send side BWE. Do nothing.
|
|
|
|
|
// TODO(nisse): Without this check, we may produce RTCP feedback
|
|
|
|
|
// packets even when not negotiated. But it would be cleaner to
|
|
|
|
|
// move the check down to RTCPSender::SendFeedbackPacket, which
|
|
|
|
|
// would also help the PacketRouter to select an appropriate rtp
|
|
|
|
|
// module in the case that some, but not all, have RTCP feedback
|
|
|
|
|
// enabled.
|
|
|
|
|
return;
|
|
|
|
|
}
|
|
|
|
|
// For audio, we only support send side BWE.
|
Reland of Don't hardcode MediaType::ANY in FakeNetworkPipe. (patchset #1 id:1 of https://codereview.webrtc.org/2784543002/ )
Reason for revert:
Intend to fix perf failures and reland.
Original issue's description:
> Revert of Don't hardcode MediaType::ANY in FakeNetworkPipe. (patchset #4 id:60001 of https://codereview.webrtc.org/2774463003/ )
>
> Reason for revert:
> Reverting since this seems to break multiple WebRTC Perf buildbots
>
> Original issue's description:
> > Don't hardcode MediaType::ANY in FakeNetworkPipe.
> >
> > Instead let each test set the appropriate media type. This simplifies
> > demuxing in Call and later in RtpTransportController.
> >
> > BUG=webrtc:7135
> >
> > Review-Url: https://codereview.webrtc.org/2774463003
> > Cr-Commit-Position: refs/heads/master@{#17418}
> > Committed: https://chromium.googlesource.com/external/webrtc/+/9c47b00e24da2941eb095df5a4459c6d98a8a88d
>
> TBR=stefan@webrtc.org,deadbeef@webrtc.org,solenberg@webrtc.org,pbos@webrtc.org,sprang@webrtc.org,nisse@webrtc.org
> # Skipping CQ checks because original CL landed less than 1 days ago.
> NOPRESUBMIT=true
> NOTREECHECKS=true
> NOTRY=true
> BUG=webrtc:7135
>
> Review-Url: https://codereview.webrtc.org/2784543002
> Cr-Commit-Position: refs/heads/master@{#17427}
> Committed: https://chromium.googlesource.com/external/webrtc/+/3a3bd5061089da5327fc549337a8430054d66057
TBR=stefan@webrtc.org,deadbeef@webrtc.org,solenberg@webrtc.org,pbos@webrtc.org,sprang@webrtc.org,lliuu@webrtc.org
# Skipping CQ checks because original CL landed less than 1 days ago.
NOPRESUBMIT=true
NOTREECHECKS=true
NOTRY=true
BUG=webrtc:7135
Review-Url: https://codereview.webrtc.org/2783853002
Cr-Commit-Position: refs/heads/master@{#17459}
2017-03-29 23:57:43 -07:00
|
|
|
if (media_type == MediaType::VIDEO ||
|
2017-02-07 01:18:43 -08:00
|
|
|
(use_send_side_bwe && header.extension.hasTransportSequenceNumber)) {
|
2017-03-21 06:41:12 -07:00
|
|
|
receive_side_cc_.OnReceivedPacket(
|
2017-02-06 02:23:00 -08:00
|
|
|
packet.arrival_time_ms(), packet.payload_size() + packet.padding_size(),
|
|
|
|
|
header);
|
|
|
|
|
}
|
2016-12-21 06:37:18 -08:00
|
|
|
}
|
|
|
|
|
|
2013-05-16 12:08:03 +00:00
|
|
|
} // namespace internal
|
2017-03-27 05:36:15 -07:00
|
|
|
|
2013-05-16 12:08:03 +00:00
|
|
|
} // namespace webrtc
|