OLD | NEW |
1 /* | 1 /* |
2 * Copyright (c) 2015 The WebRTC project authors. All Rights Reserved. | 2 * Copyright (c) 2015 The WebRTC project authors. All Rights Reserved. |
3 * | 3 * |
4 * Use of this source code is governed by a BSD-style license | 4 * Use of this source code is governed by a BSD-style license |
5 * that can be found in the LICENSE file in the root of the source | 5 * that can be found in the LICENSE file in the root of the source |
6 * tree. An additional intellectual property rights grant can be found | 6 * tree. An additional intellectual property rights grant can be found |
7 * in the file PATENTS. All contributing project authors may | 7 * in the file PATENTS. All contributing project authors may |
8 * be found in the AUTHORS file in the root of the source tree. | 8 * be found in the AUTHORS file in the root of the source tree. |
9 */ | 9 */ |
10 | 10 |
(...skipping 15 matching lines...) Expand all Loading... |
26 #include "webrtc/modules/rtp_rtcp/source/rtcp_packet/app.h" | 26 #include "webrtc/modules/rtp_rtcp/source/rtcp_packet/app.h" |
27 #include "webrtc/modules/rtp_rtcp/source/rtcp_packet/bye.h" | 27 #include "webrtc/modules/rtp_rtcp/source/rtcp_packet/bye.h" |
28 #include "webrtc/modules/rtp_rtcp/source/rtcp_packet/common_header.h" | 28 #include "webrtc/modules/rtp_rtcp/source/rtcp_packet/common_header.h" |
29 #include "webrtc/modules/rtp_rtcp/source/rtcp_packet/extended_jitter_report.h" | 29 #include "webrtc/modules/rtp_rtcp/source/rtcp_packet/extended_jitter_report.h" |
30 #include "webrtc/modules/rtp_rtcp/source/rtcp_packet/extended_reports.h" | 30 #include "webrtc/modules/rtp_rtcp/source/rtcp_packet/extended_reports.h" |
31 #include "webrtc/modules/rtp_rtcp/source/rtcp_packet/psfb.h" | 31 #include "webrtc/modules/rtp_rtcp/source/rtcp_packet/psfb.h" |
32 #include "webrtc/modules/rtp_rtcp/source/rtcp_packet/receiver_report.h" | 32 #include "webrtc/modules/rtp_rtcp/source/rtcp_packet/receiver_report.h" |
33 #include "webrtc/modules/rtp_rtcp/source/rtcp_packet/rtpfb.h" | 33 #include "webrtc/modules/rtp_rtcp/source/rtcp_packet/rtpfb.h" |
34 #include "webrtc/modules/rtp_rtcp/source/rtcp_packet/sdes.h" | 34 #include "webrtc/modules/rtp_rtcp/source/rtcp_packet/sdes.h" |
35 #include "webrtc/modules/rtp_rtcp/source/rtcp_packet/sender_report.h" | 35 #include "webrtc/modules/rtp_rtcp/source/rtcp_packet/sender_report.h" |
| 36 #include "webrtc/modules/rtp_rtcp/source/rtp_packet_received.h" |
| 37 #include "webrtc/modules/rtp_rtcp/source/rtp_packet_to_send.h" |
36 #include "webrtc/rtc_base/checks.h" | 38 #include "webrtc/rtc_base/checks.h" |
37 #include "webrtc/rtc_base/constructormagic.h" | 39 #include "webrtc/rtc_base/constructormagic.h" |
38 #include "webrtc/rtc_base/event.h" | 40 #include "webrtc/rtc_base/event.h" |
39 #include "webrtc/rtc_base/ignore_wundef.h" | 41 #include "webrtc/rtc_base/ignore_wundef.h" |
40 #include "webrtc/rtc_base/logging.h" | 42 #include "webrtc/rtc_base/logging.h" |
41 #include "webrtc/rtc_base/protobuf_utils.h" | 43 #include "webrtc/rtc_base/protobuf_utils.h" |
42 #include "webrtc/rtc_base/ptr_util.h" | 44 #include "webrtc/rtc_base/ptr_util.h" |
43 #include "webrtc/rtc_base/sequenced_task_checker.h" | 45 #include "webrtc/rtc_base/sequenced_task_checker.h" |
44 #include "webrtc/rtc_base/task_queue.h" | 46 #include "webrtc/rtc_base/task_queue.h" |
45 #include "webrtc/rtc_base/thread_annotations.h" | 47 #include "webrtc/rtc_base/thread_annotations.h" |
(...skipping 60 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
106 | 108 |
107 bool StartLogging(const std::string& file_name, | 109 bool StartLogging(const std::string& file_name, |
108 int64_t max_size_bytes) override; | 110 int64_t max_size_bytes) override; |
109 bool StartLogging(rtc::PlatformFile platform_file, | 111 bool StartLogging(rtc::PlatformFile platform_file, |
110 int64_t max_size_bytes) override; | 112 int64_t max_size_bytes) override; |
111 void StopLogging() override; | 113 void StopLogging() override; |
112 void LogVideoReceiveStreamConfig(const rtclog::StreamConfig& config) override; | 114 void LogVideoReceiveStreamConfig(const rtclog::StreamConfig& config) override; |
113 void LogVideoSendStreamConfig(const rtclog::StreamConfig& config) override; | 115 void LogVideoSendStreamConfig(const rtclog::StreamConfig& config) override; |
114 void LogAudioReceiveStreamConfig(const rtclog::StreamConfig& config) override; | 116 void LogAudioReceiveStreamConfig(const rtclog::StreamConfig& config) override; |
115 void LogAudioSendStreamConfig(const rtclog::StreamConfig& config) override; | 117 void LogAudioSendStreamConfig(const rtclog::StreamConfig& config) override; |
| 118 // TODO(terelius): This can be removed as soon as the interface has been |
| 119 // updated. |
116 void LogRtpHeader(PacketDirection direction, | 120 void LogRtpHeader(PacketDirection direction, |
117 const uint8_t* header, | 121 const uint8_t* header, |
118 size_t packet_length) override; | 122 size_t packet_length) override; |
| 123 // TODO(terelius): This can be made private, non-virtual as soon as the |
| 124 // interface has been updated. |
119 void LogRtpHeader(PacketDirection direction, | 125 void LogRtpHeader(PacketDirection direction, |
120 const uint8_t* header, | 126 const uint8_t* header, |
121 size_t packet_length, | 127 size_t packet_length, |
122 int probe_cluster_id) override; | 128 int probe_cluster_id) override; |
| 129 void LogIncomingRtpHeader(const RtpPacketReceived& packet) override; |
| 130 void LogOutgoingRtpHeader(const RtpPacketToSend& packet, |
| 131 int probe_cluster_id) override; |
| 132 // TODO(terelius): This can be made private, non-virtual as soon as the |
| 133 // interface has been updated. |
123 void LogRtcpPacket(PacketDirection direction, | 134 void LogRtcpPacket(PacketDirection direction, |
124 const uint8_t* packet, | 135 const uint8_t* packet, |
125 size_t length) override; | 136 size_t length) override; |
| 137 void LogIncomingRtcpPacket(rtc::ArrayView<const uint8_t> packet) override; |
| 138 void LogOutgoingRtcpPacket(rtc::ArrayView<const uint8_t> packet) override; |
126 void LogAudioPlayout(uint32_t ssrc) override; | 139 void LogAudioPlayout(uint32_t ssrc) override; |
127 void LogLossBasedBweUpdate(int32_t bitrate_bps, | 140 void LogLossBasedBweUpdate(int32_t bitrate_bps, |
128 uint8_t fraction_loss, | 141 uint8_t fraction_loss, |
129 int32_t total_packets) override; | 142 int32_t total_packets) override; |
130 void LogDelayBasedBweUpdate(int32_t bitrate_bps, | 143 void LogDelayBasedBweUpdate(int32_t bitrate_bps, |
131 BandwidthUsage detector_state) override; | 144 BandwidthUsage detector_state) override; |
132 void LogAudioNetworkAdaptation( | 145 void LogAudioNetworkAdaptation( |
133 const AudioEncoderRuntimeConfig& config) override; | 146 const AudioEncoderRuntimeConfig& config) override; |
134 void LogProbeClusterCreated(int id, | 147 void LogProbeClusterCreated(int id, |
135 int bitrate_bps, | 148 int bitrate_bps, |
(...skipping 283 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
419 for (const auto& e : config.rtp_extensions) { | 432 for (const auto& e : config.rtp_extensions) { |
420 rtclog::RtpHeaderExtension* extension = | 433 rtclog::RtpHeaderExtension* extension = |
421 sender_config->add_header_extensions(); | 434 sender_config->add_header_extensions(); |
422 extension->set_name(e.uri); | 435 extension->set_name(e.uri); |
423 extension->set_id(e.id); | 436 extension->set_id(e.id); |
424 } | 437 } |
425 | 438 |
426 StoreEvent(std::move(event)); | 439 StoreEvent(std::move(event)); |
427 } | 440 } |
428 | 441 |
| 442 void RtcEventLogImpl::LogIncomingRtpHeader(const RtpPacketReceived& packet) { |
| 443 LogRtpHeader(kIncomingPacket, packet.data(), packet.size(), |
| 444 PacedPacketInfo::kNotAProbe); |
| 445 } |
| 446 |
| 447 void RtcEventLogImpl::LogOutgoingRtpHeader(const RtpPacketToSend& packet, |
| 448 int probe_cluster_id) { |
| 449 LogRtpHeader(kOutgoingPacket, packet.data(), packet.size(), probe_cluster_id); |
| 450 } |
| 451 |
429 void RtcEventLogImpl::LogRtpHeader(PacketDirection direction, | 452 void RtcEventLogImpl::LogRtpHeader(PacketDirection direction, |
430 const uint8_t* header, | 453 const uint8_t* header, |
431 size_t packet_length) { | 454 size_t packet_length) { |
432 LogRtpHeader(direction, header, packet_length, PacedPacketInfo::kNotAProbe); | 455 LogRtpHeader(direction, header, packet_length, PacedPacketInfo::kNotAProbe); |
433 } | 456 } |
434 | 457 |
435 void RtcEventLogImpl::LogRtpHeader(PacketDirection direction, | 458 void RtcEventLogImpl::LogRtpHeader(PacketDirection direction, |
436 const uint8_t* header, | 459 const uint8_t* header, |
437 size_t packet_length, | 460 size_t packet_length, |
438 int probe_cluster_id) { | 461 int probe_cluster_id) { |
(...skipping 17 matching lines...) Expand all Loading... |
456 rtp_event->set_timestamp_us(rtc::TimeMicros()); | 479 rtp_event->set_timestamp_us(rtc::TimeMicros()); |
457 rtp_event->set_type(rtclog::Event::RTP_EVENT); | 480 rtp_event->set_type(rtclog::Event::RTP_EVENT); |
458 rtp_event->mutable_rtp_packet()->set_incoming(direction == kIncomingPacket); | 481 rtp_event->mutable_rtp_packet()->set_incoming(direction == kIncomingPacket); |
459 rtp_event->mutable_rtp_packet()->set_packet_length(packet_length); | 482 rtp_event->mutable_rtp_packet()->set_packet_length(packet_length); |
460 rtp_event->mutable_rtp_packet()->set_header(header, header_length); | 483 rtp_event->mutable_rtp_packet()->set_header(header, header_length); |
461 if (probe_cluster_id != PacedPacketInfo::kNotAProbe) | 484 if (probe_cluster_id != PacedPacketInfo::kNotAProbe) |
462 rtp_event->mutable_rtp_packet()->set_probe_cluster_id(probe_cluster_id); | 485 rtp_event->mutable_rtp_packet()->set_probe_cluster_id(probe_cluster_id); |
463 StoreEvent(std::move(rtp_event)); | 486 StoreEvent(std::move(rtp_event)); |
464 } | 487 } |
465 | 488 |
| 489 void RtcEventLogImpl::LogIncomingRtcpPacket( |
| 490 rtc::ArrayView<const uint8_t> packet) { |
| 491 LogRtcpPacket(kIncomingPacket, packet.data(), packet.size()); |
| 492 } |
| 493 |
| 494 void RtcEventLogImpl::LogOutgoingRtcpPacket( |
| 495 rtc::ArrayView<const uint8_t> packet) { |
| 496 LogRtcpPacket(kOutgoingPacket, packet.data(), packet.size()); |
| 497 } |
| 498 |
466 void RtcEventLogImpl::LogRtcpPacket(PacketDirection direction, | 499 void RtcEventLogImpl::LogRtcpPacket(PacketDirection direction, |
467 const uint8_t* packet, | 500 const uint8_t* packet, |
468 size_t length) { | 501 size_t length) { |
469 std::unique_ptr<rtclog::Event> rtcp_event(new rtclog::Event()); | 502 std::unique_ptr<rtclog::Event> rtcp_event(new rtclog::Event()); |
470 rtcp_event->set_timestamp_us(rtc::TimeMicros()); | 503 rtcp_event->set_timestamp_us(rtc::TimeMicros()); |
471 rtcp_event->set_type(rtclog::Event::RTCP_EVENT); | 504 rtcp_event->set_type(rtclog::Event::RTCP_EVENT); |
472 rtcp_event->mutable_rtcp_packet()->set_incoming(direction == kIncomingPacket); | 505 rtcp_event->mutable_rtcp_packet()->set_incoming(direction == kIncomingPacket); |
473 | 506 |
474 rtcp::CommonHeader header; | 507 rtcp::CommonHeader header; |
475 const uint8_t* block_begin = packet; | 508 const uint8_t* block_begin = packet; |
(...skipping 344 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
820 #else | 853 #else |
821 return CreateNull(); | 854 return CreateNull(); |
822 #endif // ENABLE_RTC_EVENT_LOG | 855 #endif // ENABLE_RTC_EVENT_LOG |
823 } | 856 } |
824 | 857 |
825 std::unique_ptr<RtcEventLog> RtcEventLog::CreateNull() { | 858 std::unique_ptr<RtcEventLog> RtcEventLog::CreateNull() { |
826 return std::unique_ptr<RtcEventLog>(new RtcEventLogNullImpl()); | 859 return std::unique_ptr<RtcEventLog>(new RtcEventLogNullImpl()); |
827 } | 860 } |
828 | 861 |
829 } // namespace webrtc | 862 } // namespace webrtc |
OLD | NEW |