Chromium Code Reviews| Index: webrtc/video/call.cc |
| diff --git a/webrtc/video/call.cc b/webrtc/video/call.cc |
| index a2f07aa590f24e20e09e90db512517cd167bf881..543b3079b8f0f30127e4ab8bd2f84d7a8b4d8726 100644 |
| --- a/webrtc/video/call.cc |
| +++ b/webrtc/video/call.cc |
| @@ -32,8 +32,10 @@ |
| #include "webrtc/system_wrappers/interface/trace.h" |
| #include "webrtc/system_wrappers/interface/trace_event.h" |
| #include "webrtc/video/audio_receive_stream.h" |
| +#include "webrtc/video/rtc_event_log.h" |
| #include "webrtc/video/video_receive_stream.h" |
| #include "webrtc/video/video_send_stream.h" |
| +#include "webrtc/voice_engine/include/voe_codec.h" |
| namespace webrtc { |
| @@ -143,6 +145,8 @@ class Call : public webrtc::Call, public PacketReceiver { |
| VideoSendStream::RtpStateMap suspended_video_send_ssrcs_; |
| + RtcEventLog* event_log_; |
| + |
| DISALLOW_COPY_AND_ASSIGN(Call); |
| }; |
| } // namespace internal |
| @@ -162,7 +166,8 @@ Call::Call(const Call::Config& config) |
| network_enabled_(true), |
| transport_adapter_(nullptr), |
| receive_crit_(RWLockWrapper::CreateRWLock()), |
| - send_crit_(RWLockWrapper::CreateRWLock()) { |
| + send_crit_(RWLockWrapper::CreateRWLock()), |
| + event_log_(nullptr) { |
| DCHECK(config.send_transport != nullptr); |
| DCHECK_GE(config.bitrate_config.min_bitrate_bps, 0); |
| @@ -172,6 +177,13 @@ Call::Call(const Call::Config& config) |
| DCHECK_GE(config.bitrate_config.max_bitrate_bps, |
| config.bitrate_config.start_bitrate_bps); |
| } |
| + if (config.voice_engine) { |
| + VoECodec* voe_codec = VoECodec::GetInterface(config.voice_engine); |
| + if (voe_codec) { |
| + event_log_ = voe_codec->GetEventLog(); |
| + voe_codec->Release(); |
| + } |
| + } |
| Trace::CreateTrace(); |
| module_process_thread_->Start(); |
| @@ -268,6 +280,9 @@ webrtc::VideoSendStream* Call::CreateVideoSendStream( |
| } |
| video_send_streams_.insert(send_stream); |
| + if (event_log_) |
| + event_log_->LogVideoSendStreamConfig(config); |
| + |
| if (!network_enabled_) |
| send_stream->SignalNetworkState(kNetworkDown); |
| return send_stream; |
| @@ -334,6 +349,9 @@ webrtc::VideoReceiveStream* Call::CreateVideoReceiveStream( |
| if (!network_enabled_) |
| receive_stream->SignalNetworkState(kNetworkDown); |
| + if (event_log_) |
| + event_log_->LogVideoReceiveStreamConfig(config); |
| + |
| return receive_stream; |
| } |
| @@ -495,15 +513,21 @@ PacketReceiver::DeliveryStatus Call::DeliverRtcp(MediaType media_type, |
| if (media_type == MediaType::ANY || media_type == MediaType::VIDEO) { |
| ReadLockScoped read_lock(*receive_crit_); |
| for (VideoReceiveStream* stream : video_receive_streams_) { |
| - if (stream->DeliverRtcp(packet, length)) |
| + if (stream->DeliverRtcp(packet, length)) { |
| rtcp_delivered = true; |
| + if (event_log_) |
| + event_log_->LogRtcpPacket(true, media_type, packet, length); |
| + } |
| } |
| } |
| if (media_type == MediaType::ANY || media_type == MediaType::VIDEO) { |
| ReadLockScoped read_lock(*send_crit_); |
| for (VideoSendStream* stream : video_send_streams_) { |
| - if (stream->DeliverRtcp(packet, length)) |
| + if (stream->DeliverRtcp(packet, length)) { |
| rtcp_delivered = true; |
| + if (event_log_) |
| + event_log_->LogRtcpPacket(false, media_type, packet, length); |
|
hlundin-webrtc
2015/08/04 09:14:47
This looks like the same RTCP packet being logged
ivoc
2015/08/05 07:39:04
That is what I was hoping for, but I am not entire
hlundin-webrtc
2015/08/05 08:32:13
I think this made things worse. Keep it as it was.
ivoc
2015/08/05 09:12:41
Ok, reverted to the previous version.
|
| + } |
| } |
| } |
| return rtcp_delivered ? DELIVERY_OK : DELIVERY_PACKET_ERROR; |
| @@ -518,6 +542,10 @@ PacketReceiver::DeliveryStatus Call::DeliverRtp(MediaType media_type, |
| uint32_t ssrc = ByteReader<uint32_t>::ReadBigEndian(&packet[8]); |
| + // TODO(ivoc): This should be updated once the splitting of the header is done |
| + // in the RtcEventLog. |
| + if (event_log_) |
| + event_log_->LogRtpHeader(true, media_type, packet, 20, length); |
|
hlundin-webrtc
2015/08/04 09:14:47
What is "20"?
ivoc
2015/08/05 07:39:04
It indicates that only the first 20 bytes of the p
hlundin-webrtc
2015/08/05 08:32:13
Acknowledged.
|
| ReadLockScoped read_lock(*receive_crit_); |
| if (media_type == MediaType::ANY || media_type == MediaType::AUDIO) { |
| auto it = audio_receive_ssrcs_.find(ssrc); |