| Index: webrtc/voice_engine/channel.cc | 
| diff --git a/webrtc/voice_engine/channel.cc b/webrtc/voice_engine/channel.cc | 
| index 4dd231b723c8794bc1d739ab0c05eee2d2b3196a..dfefdc1b4ec8ed1ad6fd041844c6d642c1682906 100644 | 
| --- a/webrtc/voice_engine/channel.cc | 
| +++ b/webrtc/voice_engine/channel.cc | 
| @@ -21,6 +21,7 @@ | 
| #include "webrtc/base/timeutils.h" | 
| #include "webrtc/common.h" | 
| #include "webrtc/config.h" | 
| +#include "webrtc/call/rtc_event_log.h" | 
| #include "webrtc/modules/audio_device/include/audio_device.h" | 
| #include "webrtc/modules/audio_processing/include/audio_processing.h" | 
| #include "webrtc/modules/include/module_common_types.h" | 
| @@ -45,6 +46,88 @@ namespace voe { | 
|  | 
| const int kTelephoneEventAttenuationdB = 10; | 
|  | 
| +class RtcEventLogProxy final : public webrtc::RtcEventLog { | 
| + public: | 
| +  RtcEventLogProxy() : event_log_(nullptr) {} | 
| + | 
| +  void SetBufferDuration(int64_t buffer_duration_us) override { | 
| +    RTC_NOTREACHED(); | 
| +  } | 
| + | 
| +  void StartLogging(const std::string& file_name, int duration_ms) override { | 
| +    RTC_NOTREACHED(); | 
| +  } | 
| + | 
| +  bool StartLogging(rtc::PlatformFile log_file, | 
| +                    int64_t max_size_bytes) override { | 
| +    RTC_NOTREACHED(); | 
| +  } | 
| + | 
| +  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) { | 
| @@ -465,11 +548,9 @@ bool Channel::OnRecoveredPacket(const uint8_t* rtp_packet, | 
| } | 
|  | 
| int32_t Channel::GetAudioFrame(int32_t id, AudioFrame* audioFrame) { | 
| -  if (event_log_) { | 
| -    unsigned int ssrc; | 
| -    RTC_CHECK_EQ(GetLocalSSRC(ssrc), 0); | 
| -    event_log_->LogAudioPlayout(ssrc); | 
| -  } | 
| +  unsigned int ssrc; | 
| +  RTC_CHECK_EQ(GetLocalSSRC(ssrc), 0); | 
| +  event_log_proxy_->LogAudioPlayout(ssrc); | 
| // Get 10ms raw PCM data from the ACM (mixer limits output frequency) | 
| if (audio_coding_->PlayoutData10Ms(audioFrame->sample_rate_hz_, audioFrame) == | 
| -1) { | 
| @@ -645,13 +726,12 @@ int32_t Channel::NeededFrequency(int32_t id) const { | 
| int32_t Channel::CreateChannel(Channel*& channel, | 
| int32_t channelId, | 
| uint32_t instanceId, | 
| -                               RtcEventLog* const event_log, | 
| const Config& config) { | 
| WEBRTC_TRACE(kTraceMemory, kTraceVoice, VoEId(instanceId, channelId), | 
| "Channel::CreateChannel(channelId=%d, instanceId=%d)", channelId, | 
| instanceId); | 
|  | 
| -  channel = new Channel(channelId, instanceId, event_log, config); | 
| +  channel = new Channel(channelId, instanceId, config); | 
| if (channel == NULL) { | 
| WEBRTC_TRACE(kTraceMemory, kTraceVoice, VoEId(instanceId, channelId), | 
| "Channel::CreateChannel() unable to allocate memory for" | 
| @@ -708,13 +788,10 @@ void Channel::RecordFileEnded(int32_t id) { | 
| " shutdown"); | 
| } | 
|  | 
| -Channel::Channel(int32_t channelId, | 
| -                 uint32_t instanceId, | 
| -                 RtcEventLog* const event_log, | 
| -                 const Config& config) | 
| +Channel::Channel(int32_t channelId, uint32_t instanceId, const Config& config) | 
| : _instanceId(instanceId), | 
| _channelId(channelId), | 
| -      event_log_(event_log), | 
| +      event_log_proxy_(new RtcEventLogProxy()), | 
| rtp_header_parser_(RtpHeaderParser::Create()), | 
| rtp_payload_registry_( | 
| new RTPPayloadRegistry(RTPPayloadStrategy::CreateStrategy(true))), | 
| @@ -815,7 +892,7 @@ Channel::Channel(int32_t channelId, | 
| seq_num_allocator_proxy_.get(); | 
| configuration.transport_feedback_callback = feedback_observer_proxy_.get(); | 
| } | 
| -  configuration.event_log = event_log; | 
| +  configuration.event_log = &(*event_log_proxy_); | 
|  | 
| _rtpRtcpModule.reset(RtpRtcp::CreateRtpRtcp(configuration)); | 
| _rtpRtcpModule->SetSendingMediaStatus(false); | 
| @@ -3022,6 +3099,10 @@ void Channel::DisassociateSendChannel(int channel_id) { | 
| } | 
| } | 
|  | 
| +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), | 
|  |