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 35 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
46 ~RtcEventLogImpl() override; | 46 ~RtcEventLogImpl() override; |
47 | 47 |
48 bool StartLogging(const std::string& file_name, | 48 bool StartLogging(const std::string& file_name, |
49 int64_t max_size_bytes) override; | 49 int64_t max_size_bytes) override; |
50 bool StartLogging(rtc::PlatformFile platform_file, | 50 bool StartLogging(rtc::PlatformFile platform_file, |
51 int64_t max_size_bytes) override; | 51 int64_t max_size_bytes) override; |
52 void StopLogging() override; | 52 void StopLogging() override; |
53 void LogVideoReceiveStreamConfig( | 53 void LogVideoReceiveStreamConfig( |
54 const VideoReceiveStream::Config& config) override; | 54 const VideoReceiveStream::Config& config) override; |
55 void LogVideoSendStreamConfig(const VideoSendStream::Config& config) override; | 55 void LogVideoSendStreamConfig(const VideoSendStream::Config& config) override; |
| 56 void LogAudioReceiveStreamConfig( |
| 57 const AudioReceiveStream::Config& config) override; |
| 58 void LogAudioSendStreamConfig(const AudioSendStream::Config& config) override; |
56 void LogRtpHeader(PacketDirection direction, | 59 void LogRtpHeader(PacketDirection direction, |
57 MediaType media_type, | 60 MediaType media_type, |
58 const uint8_t* header, | 61 const uint8_t* header, |
59 size_t packet_length) override; | 62 size_t packet_length) override; |
60 void LogRtcpPacket(PacketDirection direction, | 63 void LogRtcpPacket(PacketDirection direction, |
61 MediaType media_type, | 64 MediaType media_type, |
62 const uint8_t* packet, | 65 const uint8_t* packet, |
63 size_t length) override; | 66 size_t length) override; |
64 void LogAudioPlayout(uint32_t ssrc) override; | 67 void LogAudioPlayout(uint32_t ssrc) override; |
65 void LogBwePacketLossEvent(int32_t bitrate, | 68 void LogBwePacketLossEvent(int32_t bitrate, |
(...skipping 212 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
278 sender_config->add_rtx_ssrcs(rtx_ssrc); | 281 sender_config->add_rtx_ssrcs(rtx_ssrc); |
279 } | 282 } |
280 sender_config->set_rtx_payload_type(config.rtp.rtx.payload_type); | 283 sender_config->set_rtx_payload_type(config.rtp.rtx.payload_type); |
281 | 284 |
282 rtclog::EncoderConfig* encoder = sender_config->mutable_encoder(); | 285 rtclog::EncoderConfig* encoder = sender_config->mutable_encoder(); |
283 encoder->set_name(config.encoder_settings.payload_name); | 286 encoder->set_name(config.encoder_settings.payload_name); |
284 encoder->set_payload_type(config.encoder_settings.payload_type); | 287 encoder->set_payload_type(config.encoder_settings.payload_type); |
285 StoreEvent(&event); | 288 StoreEvent(&event); |
286 } | 289 } |
287 | 290 |
| 291 void RtcEventLogImpl::LogAudioReceiveStreamConfig( |
| 292 const AudioReceiveStream::Config& config) { |
| 293 std::unique_ptr<rtclog::Event> event(new rtclog::Event()); |
| 294 event->set_timestamp_us(clock_->TimeInMicroseconds()); |
| 295 event->set_type(rtclog::Event::AUDIO_RECEIVER_CONFIG_EVENT); |
| 296 |
| 297 rtclog::AudioReceiveConfig* receiver_config = |
| 298 event->mutable_audio_receiver_config(); |
| 299 receiver_config->set_remote_ssrc(config.rtp.remote_ssrc); |
| 300 receiver_config->set_local_ssrc(config.rtp.local_ssrc); |
| 301 |
| 302 for (const auto& e : config.rtp.extensions) { |
| 303 rtclog::RtpHeaderExtension* extension = |
| 304 receiver_config->add_header_extensions(); |
| 305 extension->set_name(e.uri); |
| 306 extension->set_id(e.id); |
| 307 } |
| 308 StoreEvent(&event); |
| 309 } |
| 310 |
| 311 void RtcEventLogImpl::LogAudioSendStreamConfig( |
| 312 const AudioSendStream::Config& config) { |
| 313 std::unique_ptr<rtclog::Event> event(new rtclog::Event()); |
| 314 event->set_timestamp_us(clock_->TimeInMicroseconds()); |
| 315 event->set_type(rtclog::Event::AUDIO_SENDER_CONFIG_EVENT); |
| 316 |
| 317 rtclog::AudioSendConfig* sender_config = event->mutable_audio_sender_config(); |
| 318 |
| 319 sender_config->set_ssrc(config.rtp.ssrc); |
| 320 |
| 321 for (const auto& e : config.rtp.extensions) { |
| 322 rtclog::RtpHeaderExtension* extension = |
| 323 sender_config->add_header_extensions(); |
| 324 extension->set_name(e.uri); |
| 325 extension->set_id(e.id); |
| 326 } |
| 327 |
| 328 StoreEvent(&event); |
| 329 } |
| 330 |
288 void RtcEventLogImpl::LogRtpHeader(PacketDirection direction, | 331 void RtcEventLogImpl::LogRtpHeader(PacketDirection direction, |
289 MediaType media_type, | 332 MediaType media_type, |
290 const uint8_t* header, | 333 const uint8_t* header, |
291 size_t packet_length) { | 334 size_t packet_length) { |
292 // Read header length (in bytes) from packet data. | 335 // Read header length (in bytes) from packet data. |
293 if (packet_length < 12u) { | 336 if (packet_length < 12u) { |
294 return; // Don't read outside the packet. | 337 return; // Don't read outside the packet. |
295 } | 338 } |
296 const bool x = (header[0] & 0x10) != 0; | 339 const bool x = (header[0] & 0x10) != 0; |
297 const uint8_t cc = header[0] & 0x0f; | 340 const uint8_t cc = header[0] & 0x0f; |
(...skipping 138 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
436 #else | 479 #else |
437 return std::unique_ptr<RtcEventLog>(new RtcEventLogNullImpl()); | 480 return std::unique_ptr<RtcEventLog>(new RtcEventLogNullImpl()); |
438 #endif // ENABLE_RTC_EVENT_LOG | 481 #endif // ENABLE_RTC_EVENT_LOG |
439 } | 482 } |
440 | 483 |
441 std::unique_ptr<RtcEventLog> RtcEventLog::CreateNull() { | 484 std::unique_ptr<RtcEventLog> RtcEventLog::CreateNull() { |
442 return std::unique_ptr<RtcEventLog>(new RtcEventLogNullImpl()); | 485 return std::unique_ptr<RtcEventLog>(new RtcEventLogNullImpl()); |
443 } | 486 } |
444 | 487 |
445 } // namespace webrtc | 488 } // namespace webrtc |
OLD | NEW |