| Index: webrtc/audio/audio_receive_stream.cc
|
| diff --git a/webrtc/audio/audio_receive_stream.cc b/webrtc/audio/audio_receive_stream.cc
|
| index 0fd96d01cc9fd4a9730d81d7c65fa7782070d479..c725e37477af5f36b6a9a18c3556475d12b94b3e 100644
|
| --- a/webrtc/audio/audio_receive_stream.cc
|
| +++ b/webrtc/audio/audio_receive_stream.cc
|
| @@ -12,17 +12,10 @@
|
|
|
| #include <string>
|
|
|
| -#include "webrtc/audio/conversion.h"
|
| #include "webrtc/base/checks.h"
|
| #include "webrtc/base/logging.h"
|
| #include "webrtc/modules/remote_bitrate_estimator/include/remote_bitrate_estimator.h"
|
| #include "webrtc/system_wrappers/interface/tick_util.h"
|
| -#include "webrtc/voice_engine/include/voe_base.h"
|
| -#include "webrtc/voice_engine/include/voe_codec.h"
|
| -#include "webrtc/voice_engine/include/voe_neteq_stats.h"
|
| -#include "webrtc/voice_engine/include/voe_rtp_rtcp.h"
|
| -#include "webrtc/voice_engine/include/voe_video_sync.h"
|
| -#include "webrtc/voice_engine/include/voe_volume_control.h"
|
|
|
| namespace webrtc {
|
| std::string AudioReceiveStream::Config::Rtp::ToString() const {
|
| @@ -31,9 +24,8 @@
|
| ss << ", extensions: [";
|
| for (size_t i = 0; i < extensions.size(); ++i) {
|
| ss << extensions[i].ToString();
|
| - if (i != extensions.size() - 1) {
|
| + if (i != extensions.size() - 1)
|
| ss << ", ";
|
| - }
|
| }
|
| ss << ']';
|
| ss << '}';
|
| @@ -44,9 +36,8 @@
|
| std::stringstream ss;
|
| ss << "{rtp: " << rtp.ToString();
|
| ss << ", voe_channel_id: " << voe_channel_id;
|
| - if (!sync_group.empty()) {
|
| + if (!sync_group.empty())
|
| ss << ", sync_group: " << sync_group;
|
| - }
|
| ss << '}';
|
| return ss.str();
|
| }
|
| @@ -54,18 +45,13 @@
|
| namespace internal {
|
| AudioReceiveStream::AudioReceiveStream(
|
| RemoteBitrateEstimator* remote_bitrate_estimator,
|
| - const webrtc::AudioReceiveStream::Config& config,
|
| - VoiceEngine* voice_engine)
|
| + const webrtc::AudioReceiveStream::Config& config)
|
| : remote_bitrate_estimator_(remote_bitrate_estimator),
|
| config_(config),
|
| - voice_engine_(voice_engine),
|
| - voe_base_(voice_engine),
|
| rtp_header_parser_(RtpHeaderParser::Create()) {
|
| - RTC_DCHECK(thread_checker_.CalledOnValidThread());
|
| LOG(LS_INFO) << "AudioReceiveStream: " << config_.ToString();
|
| RTC_DCHECK(config.voe_channel_id != -1);
|
| RTC_DCHECK(remote_bitrate_estimator_ != nullptr);
|
| - RTC_DCHECK(voice_engine_ != nullptr);
|
| RTC_DCHECK(rtp_header_parser_ != nullptr);
|
| for (const auto& ext : config.rtp.extensions) {
|
| // One-byte-extension local identifiers are in the range 1-14 inclusive.
|
| @@ -87,117 +73,33 @@
|
| }
|
|
|
| AudioReceiveStream::~AudioReceiveStream() {
|
| - RTC_DCHECK(thread_checker_.CalledOnValidThread());
|
| LOG(LS_INFO) << "~AudioReceiveStream: " << config_.ToString();
|
| }
|
|
|
| webrtc::AudioReceiveStream::Stats AudioReceiveStream::GetStats() const {
|
| - RTC_DCHECK(thread_checker_.CalledOnValidThread());
|
| - webrtc::AudioReceiveStream::Stats stats;
|
| - stats.remote_ssrc = config_.rtp.remote_ssrc;
|
| - ScopedVoEInterface<VoECodec> codec(voice_engine_);
|
| - ScopedVoEInterface<VoENetEqStats> neteq(voice_engine_);
|
| - ScopedVoEInterface<VoERTP_RTCP> rtp(voice_engine_);
|
| - ScopedVoEInterface<VoEVideoSync> sync(voice_engine_);
|
| - ScopedVoEInterface<VoEVolumeControl> volume(voice_engine_);
|
| - unsigned int ssrc = 0;
|
| - webrtc::CallStatistics cs = {0};
|
| - webrtc::CodecInst ci = {0};
|
| - // Only collect stats if we have seen some traffic with the SSRC.
|
| - if (rtp->GetRemoteSSRC(config_.voe_channel_id, ssrc) == -1 ||
|
| - rtp->GetRTCPStatistics(config_.voe_channel_id, cs) == -1 ||
|
| - codec->GetRecCodec(config_.voe_channel_id, ci) == -1) {
|
| - return stats;
|
| - }
|
| -
|
| - stats.bytes_rcvd = cs.bytesReceived;
|
| - stats.packets_rcvd = cs.packetsReceived;
|
| - stats.packets_lost = cs.cumulativeLost;
|
| - stats.fraction_lost = static_cast<float>(cs.fractionLost) / (1 << 8);
|
| - if (ci.pltype != -1) {
|
| - stats.codec_name = ci.plname;
|
| - }
|
| -
|
| - stats.ext_seqnum = cs.extendedMax;
|
| - if (ci.plfreq / 1000 > 0) {
|
| - stats.jitter_ms = cs.jitterSamples / (ci.plfreq / 1000);
|
| - }
|
| - {
|
| - int jitter_buffer_delay_ms = 0;
|
| - int playout_buffer_delay_ms = 0;
|
| - sync->GetDelayEstimate(config_.voe_channel_id, &jitter_buffer_delay_ms,
|
| - &playout_buffer_delay_ms);
|
| - stats.delay_estimate_ms =
|
| - jitter_buffer_delay_ms + playout_buffer_delay_ms;
|
| - }
|
| - {
|
| - unsigned int level = 0;
|
| - if (volume->GetSpeechOutputLevelFullRange(config_.voe_channel_id, level)
|
| - != -1) {
|
| - stats.audio_level = static_cast<int32_t>(level);
|
| - }
|
| - }
|
| -
|
| - webrtc::NetworkStatistics ns = {0};
|
| - if (neteq->GetNetworkStatistics(config_.voe_channel_id, ns) != -1) {
|
| - // Get jitter buffer and total delay (alg + jitter + playout) stats.
|
| - stats.jitter_buffer_ms = ns.currentBufferSize;
|
| - stats.jitter_buffer_preferred_ms = ns.preferredBufferSize;
|
| - stats.expand_rate = Q14ToFloat(ns.currentExpandRate);
|
| - stats.speech_expand_rate = Q14ToFloat(ns.currentSpeechExpandRate);
|
| - stats.secondary_decoded_rate = Q14ToFloat(ns.currentSecondaryDecodedRate);
|
| - stats.accelerate_rate = Q14ToFloat(ns.currentAccelerateRate);
|
| - stats.preemptive_expand_rate = Q14ToFloat(ns.currentPreemptiveRate);
|
| - }
|
| -
|
| - webrtc::AudioDecodingCallStats ds;
|
| - if (neteq->GetDecodingCallStatistics(config_.voe_channel_id, &ds) != -1) {
|
| - 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;
|
| - stats.decoding_plc = ds.decoded_plc;
|
| - stats.decoding_cng = ds.decoded_cng;
|
| - stats.decoding_plc_cng = ds.decoded_plc_cng;
|
| - }
|
| -
|
| - stats.capture_start_ntp_time_ms = cs.capture_start_ntp_time_ms_;
|
| -
|
| - return stats;
|
| + return webrtc::AudioReceiveStream::Stats();
|
| }
|
|
|
| const webrtc::AudioReceiveStream::Config& AudioReceiveStream::config() const {
|
| - RTC_DCHECK(thread_checker_.CalledOnValidThread());
|
| return config_;
|
| }
|
|
|
| void AudioReceiveStream::Start() {
|
| - RTC_DCHECK(thread_checker_.CalledOnValidThread());
|
| }
|
|
|
| void AudioReceiveStream::Stop() {
|
| - RTC_DCHECK(thread_checker_.CalledOnValidThread());
|
| }
|
|
|
| void AudioReceiveStream::SignalNetworkState(NetworkState state) {
|
| - RTC_DCHECK(thread_checker_.CalledOnValidThread());
|
| }
|
|
|
| bool AudioReceiveStream::DeliverRtcp(const uint8_t* packet, size_t length) {
|
| - // 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(!thread_checker_.CalledOnValidThread());
|
| return false;
|
| }
|
|
|
| bool AudioReceiveStream::DeliverRtp(const uint8_t* packet,
|
| size_t length,
|
| const PacketTime& packet_time) {
|
| - // 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(!thread_checker_.CalledOnValidThread());
|
| RTPHeader header;
|
|
|
| if (!rtp_header_parser_->Parse(packet, length, &header)) {
|
|
|