Chromium Code Reviews| Index: webrtc/call/call.cc |
| diff --git a/webrtc/call/call.cc b/webrtc/call/call.cc |
| index 41ac328eab14f44249a20d7ac0dba85a36bb9d1d..feb120397ef65ad75418fbeab1a52b57fe47820c 100644 |
| --- a/webrtc/call/call.cc |
| +++ b/webrtc/call/call.cc |
| @@ -94,6 +94,8 @@ class Call : public webrtc::Call, public PacketReceiver, |
| void OnNetworkChanged(uint32_t bitrate_bps, uint8_t fraction_loss, |
| int64_t rtt_ms) override; |
| + webrtc::RtcEventLog* RtcEventLog() override { return event_log_.get(); } |
| + |
| private: |
| DeliveryStatus DeliverRtcp(MediaType media_type, const uint8_t* packet, |
| size_t length); |
| @@ -148,7 +150,7 @@ class Call : public webrtc::Call, public PacketReceiver, |
| VideoSendStream::RtpStateMap suspended_video_send_ssrcs_; |
| - RtcEventLog* event_log_ = nullptr; |
| + rtc::scoped_ptr<webrtc::RtcEventLog> event_log_ = RtcEventLog::Create(); |
|
the sun
2016/03/03 09:25:13
Is there a thread checker in RtcEventLog::Create()
stefan-webrtc
2016/03/03 10:08:25
Use std::unique_ptr. I'd also prefer if you create
ivoc
2016/03/10 13:15:36
Done.
ivoc
2016/03/10 13:15:36
I moved the initialization to the initializer list
|
| // The following members are only accessed (exclusively) from one thread and |
| // from the destructor, and therefore doesn't need any explicit |
| @@ -210,10 +212,6 @@ Call::Call(const Call::Config& config) |
| RTC_DCHECK_GE(config.bitrate_config.max_bitrate_bps, |
| config.bitrate_config.start_bitrate_bps); |
| } |
| - if (config.audio_state.get()) { |
| - ScopedVoEInterface<VoECodec> voe_codec(voice_engine()); |
| - event_log_ = voe_codec->GetEventLog(); |
| - } |
| Trace::CreateTrace(); |
| call_stats_->RegisterStatsObserver(congestion_controller_.get()); |
| @@ -222,7 +220,7 @@ Call::Call(const Call::Config& config) |
| config_.bitrate_config.min_bitrate_bps, |
| config_.bitrate_config.start_bitrate_bps, |
| config_.bitrate_config.max_bitrate_bps); |
| - congestion_controller_->GetBitrateController()->SetEventLog(event_log_); |
| + congestion_controller_->GetBitrateController()->SetEventLog(event_log_.get()); |
|
the sun
2016/03/03 09:25:12
Could we pass the log* in the CongestionController
stefan-webrtc
2016/03/03 10:08:25
That would be nicer.
ivoc
2016/03/10 13:15:36
Good point, done.
|
| module_process_thread_->Start(); |
| module_process_thread_->RegisterModule(call_stats_.get()); |
| @@ -351,6 +349,7 @@ webrtc::AudioReceiveStream* Call::CreateAudioReceiveStream( |
| RTC_DCHECK(configuration_thread_checker_.CalledOnValidThread()); |
| AudioReceiveStream* receive_stream = new AudioReceiveStream( |
| congestion_controller_.get(), config, config_.audio_state); |
| + receive_stream->SetRtcEventLog(event_log_.get()); |
|
stefan-webrtc
2016/03/03 10:08:25
Isn't it possible to pass this via the constructor
ivoc
2016/03/10 13:15:36
Done.
|
| { |
| WriteLockScoped write_lock(*receive_crit_); |
| RTC_DCHECK(audio_receive_ssrcs_.find(config.rtp.remote_ssrc) == |
| @@ -407,8 +406,7 @@ webrtc::VideoSendStream* Call::CreateVideoSendStream( |
| } |
| video_send_streams_.insert(send_stream); |
| - if (event_log_) |
| - event_log_->LogVideoSendStreamConfig(config); |
| + event_log_->LogVideoSendStreamConfig(config); |
| return send_stream; |
| } |
| @@ -471,8 +469,7 @@ webrtc::VideoReceiveStream* Call::CreateVideoReceiveStream( |
| if (!network_enabled_) |
| receive_stream->SignalNetworkState(kNetworkDown); |
| - if (event_log_) |
| - event_log_->LogVideoReceiveStreamConfig(config); |
| + event_log_->LogVideoReceiveStreamConfig(config); |
| return receive_stream; |
| } |
| @@ -672,9 +669,7 @@ PacketReceiver::DeliveryStatus Call::DeliverRtcp(MediaType media_type, |
| for (VideoReceiveStream* stream : video_receive_streams_) { |
| if (stream->DeliverRtcp(packet, length)) { |
| rtcp_delivered = true; |
| - if (event_log_) |
| - event_log_->LogRtcpPacket(kIncomingPacket, media_type, packet, |
| - length); |
| + event_log_->LogRtcpPacket(kIncomingPacket, media_type, packet, length); |
| } |
| } |
| } |
| @@ -683,9 +678,7 @@ PacketReceiver::DeliveryStatus Call::DeliverRtcp(MediaType media_type, |
| for (VideoSendStream* stream : video_send_streams_) { |
| if (stream->DeliverRtcp(packet, length)) { |
| rtcp_delivered = true; |
| - if (event_log_) |
| - event_log_->LogRtcpPacket(kIncomingPacket, media_type, packet, |
| - length); |
| + event_log_->LogRtcpPacket(kIncomingPacket, media_type, packet, length); |
| } |
| } |
| } |
| @@ -714,7 +707,7 @@ PacketReceiver::DeliveryStatus Call::DeliverRtp(MediaType media_type, |
| auto status = it->second->DeliverRtp(packet, length, packet_time) |
| ? DELIVERY_OK |
| : DELIVERY_PACKET_ERROR; |
| - if (status == DELIVERY_OK && event_log_) |
| + if (status == DELIVERY_OK) |
| event_log_->LogRtpHeader(kIncomingPacket, media_type, packet, length); |
| return status; |
| } |
| @@ -726,7 +719,7 @@ PacketReceiver::DeliveryStatus Call::DeliverRtp(MediaType media_type, |
| auto status = it->second->DeliverRtp(packet, length, packet_time) |
| ? DELIVERY_OK |
| : DELIVERY_PACKET_ERROR; |
| - if (status == DELIVERY_OK && event_log_) |
| + if (status == DELIVERY_OK) |
| event_log_->LogRtpHeader(kIncomingPacket, media_type, packet, length); |
| return status; |
| } |