Index: webrtc/voice_engine/channel.cc |
diff --git a/webrtc/voice_engine/channel.cc b/webrtc/voice_engine/channel.cc |
index 8287668258986fe10a57738fc6cc9cd9a93c142c..943a04572be088689cb655578001dd533703c0b7 100644 |
--- a/webrtc/voice_engine/channel.cc |
+++ b/webrtc/voice_engine/channel.cc |
@@ -19,7 +19,6 @@ |
#include "webrtc/base/logging.h" |
#include "webrtc/base/thread_checker.h" |
#include "webrtc/base/timeutils.h" |
-#include "webrtc/call/rtc_event_log.h" |
#include "webrtc/common.h" |
#include "webrtc/config.h" |
#include "webrtc/modules/audio_coding/codecs/builtin_audio_decoder_factory.h" |
@@ -59,87 +58,6 @@ |
const int kTelephoneEventAttenuationdB = 10; |
-class RtcEventLogProxy final : public webrtc::RtcEventLog { |
- public: |
- RtcEventLogProxy() : event_log_(nullptr) {} |
- |
- bool StartLogging(const std::string& file_name, |
- int64_t max_size_bytes) override { |
- RTC_NOTREACHED(); |
- return false; |
- } |
- |
- bool StartLogging(rtc::PlatformFile log_file, |
- int64_t max_size_bytes) override { |
- RTC_NOTREACHED(); |
- return false; |
- } |
- |
- void StopLogging() override { RTC_NOTREACHED(); } |
- |
- void LogVideoReceiveStreamConfig( |
- const webrtc::VideoReceiveStream::Config& config) override { |
- rtc::CritScope lock(&crit_); |
- if (event_log_) { |
- event_log_->LogVideoReceiveStreamConfig(config); |
- } |
- } |
- |
- void LogVideoSendStreamConfig( |
- const webrtc::VideoSendStream::Config& config) override { |
- rtc::CritScope lock(&crit_); |
- if (event_log_) { |
- event_log_->LogVideoSendStreamConfig(config); |
- } |
- } |
- |
- void LogRtpHeader(webrtc::PacketDirection direction, |
- webrtc::MediaType media_type, |
- const uint8_t* header, |
- size_t packet_length) override { |
- rtc::CritScope lock(&crit_); |
- if (event_log_) { |
- event_log_->LogRtpHeader(direction, media_type, header, packet_length); |
- } |
- } |
- |
- void LogRtcpPacket(webrtc::PacketDirection direction, |
- webrtc::MediaType media_type, |
- const uint8_t* packet, |
- size_t length) override { |
- rtc::CritScope lock(&crit_); |
- if (event_log_) { |
- event_log_->LogRtcpPacket(direction, media_type, packet, length); |
- } |
- } |
- |
- void LogAudioPlayout(uint32_t ssrc) override { |
- rtc::CritScope lock(&crit_); |
- if (event_log_) { |
- event_log_->LogAudioPlayout(ssrc); |
- } |
- } |
- |
- void LogBwePacketLossEvent(int32_t bitrate, |
- uint8_t fraction_loss, |
- int32_t total_packets) override { |
- rtc::CritScope lock(&crit_); |
- if (event_log_) { |
- event_log_->LogBwePacketLossEvent(bitrate, fraction_loss, total_packets); |
- } |
- } |
- |
- void SetEventLog(RtcEventLog* event_log) { |
- rtc::CritScope lock(&crit_); |
- event_log_ = event_log; |
- } |
- |
- private: |
- rtc::CriticalSection crit_; |
- RtcEventLog* event_log_ GUARDED_BY(crit_); |
- RTC_DISALLOW_COPY_AND_ASSIGN(RtcEventLogProxy); |
-}; |
- |
class TransportFeedbackProxy : public TransportFeedbackObserver { |
public: |
TransportFeedbackProxy() : feedback_observer_(nullptr) { |
@@ -562,9 +480,11 @@ |
MixerParticipant::AudioFrameInfo Channel::GetAudioFrameWithMuted( |
int32_t id, |
AudioFrame* audioFrame) { |
- unsigned int ssrc; |
- RTC_CHECK_EQ(GetLocalSSRC(ssrc), 0); |
- event_log_proxy_->LogAudioPlayout(ssrc); |
+ if (event_log_) { |
+ unsigned int ssrc; |
+ RTC_CHECK_EQ(GetLocalSSRC(ssrc), 0); |
+ event_log_->LogAudioPlayout(ssrc); |
+ } |
// Get 10ms raw PCM data from the ACM (mixer limits output frequency) |
bool muted; |
if (audio_coding_->PlayoutData10Ms(audioFrame->sample_rate_hz_, audioFrame, |
@@ -751,8 +671,9 @@ |
int32_t Channel::CreateChannel(Channel*& channel, |
int32_t channelId, |
uint32_t instanceId, |
+ RtcEventLog* const event_log, |
const Config& config) { |
- return CreateChannel(channel, channelId, instanceId, config, |
+ return CreateChannel(channel, channelId, instanceId, event_log, config, |
CreateBuiltinAudioDecoderFactory()); |
} |
@@ -760,13 +681,15 @@ |
Channel*& channel, |
int32_t channelId, |
uint32_t instanceId, |
+ RtcEventLog* const event_log, |
const Config& config, |
const rtc::scoped_refptr<AudioDecoderFactory>& decoder_factory) { |
WEBRTC_TRACE(kTraceMemory, kTraceVoice, VoEId(instanceId, channelId), |
"Channel::CreateChannel(channelId=%d, instanceId=%d)", channelId, |
instanceId); |
- channel = new Channel(channelId, instanceId, config, decoder_factory); |
+ channel = |
+ new Channel(channelId, instanceId, event_log, config, decoder_factory); |
if (channel == NULL) { |
WEBRTC_TRACE(kTraceMemory, kTraceVoice, VoEId(instanceId, channelId), |
"Channel::CreateChannel() unable to allocate memory for" |
@@ -825,11 +748,12 @@ |
Channel::Channel(int32_t channelId, |
uint32_t instanceId, |
+ RtcEventLog* const event_log, |
const Config& config, |
const rtc::scoped_refptr<AudioDecoderFactory>& decoder_factory) |
: _instanceId(instanceId), |
_channelId(channelId), |
- event_log_proxy_(new RtcEventLogProxy()), |
+ event_log_(event_log), |
rtp_header_parser_(RtpHeaderParser::Create()), |
rtp_payload_registry_( |
new RTPPayloadRegistry(RTPPayloadStrategy::CreateStrategy(true))), |
@@ -932,7 +856,7 @@ |
seq_num_allocator_proxy_.get(); |
configuration.transport_feedback_callback = feedback_observer_proxy_.get(); |
} |
- configuration.event_log = &(*event_log_proxy_); |
+ configuration.event_log = event_log; |
_rtpRtcpModule.reset(RtpRtcp::CreateRtpRtcp(configuration)); |
_rtpRtcpModule->SetSendingMediaStatus(false); |
@@ -3084,10 +3008,6 @@ |
} |
} |
-void Channel::SetRtcEventLog(RtcEventLog* event_log) { |
- event_log_proxy_->SetEventLog(event_log); |
-} |
- |
int Channel::RegisterExternalMediaProcessing(ProcessingTypes type, |
VoEMediaProcess& processObject) { |
WEBRTC_TRACE(kTraceInfo, kTraceVoice, VoEId(_instanceId, _channelId), |