Chromium Code Reviews
chromiumcodereview-hr@appspot.gserviceaccount.com (chromiumcodereview-hr) | Please choose your nickname with Settings | Help | Chromium Project | Gerrit Changes | Sign out
(118)

Side by Side Diff: webrtc/logging/rtc_event_log/rtc_event_log.cc

Issue 2353543003: Added logging for audio send/receive stream configs. (Closed)
Patch Set: Another rebase. Created 4 years, 2 months ago
Use n/p to move between diff chunks; N/P to move between comments. Draft comments are only viewable by you.
Jump to:
View unified diff | Download patch
OLDNEW
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 44 matching lines...) Expand 10 before | Expand all | Expand 10 after
55 ~RtcEventLogImpl() override; 55 ~RtcEventLogImpl() override;
56 56
57 bool StartLogging(const std::string& file_name, 57 bool StartLogging(const std::string& file_name,
58 int64_t max_size_bytes) override; 58 int64_t max_size_bytes) override;
59 bool StartLogging(rtc::PlatformFile platform_file, 59 bool StartLogging(rtc::PlatformFile platform_file,
60 int64_t max_size_bytes) override; 60 int64_t max_size_bytes) override;
61 void StopLogging() override; 61 void StopLogging() override;
62 void LogVideoReceiveStreamConfig( 62 void LogVideoReceiveStreamConfig(
63 const VideoReceiveStream::Config& config) override; 63 const VideoReceiveStream::Config& config) override;
64 void LogVideoSendStreamConfig(const VideoSendStream::Config& config) override; 64 void LogVideoSendStreamConfig(const VideoSendStream::Config& config) override;
65 void LogAudioReceiveStreamConfig(
66 const AudioReceiveStream::Config& config) override;
67 void LogAudioSendStreamConfig(const AudioSendStream::Config& config) override;
65 void LogRtpHeader(PacketDirection direction, 68 void LogRtpHeader(PacketDirection direction,
66 MediaType media_type, 69 MediaType media_type,
67 const uint8_t* header, 70 const uint8_t* header,
68 size_t packet_length) override; 71 size_t packet_length) override;
69 void LogRtcpPacket(PacketDirection direction, 72 void LogRtcpPacket(PacketDirection direction,
70 MediaType media_type, 73 MediaType media_type,
71 const uint8_t* packet, 74 const uint8_t* packet,
72 size_t length) override; 75 size_t length) override;
73 void LogAudioPlayout(uint32_t ssrc) override; 76 void LogAudioPlayout(uint32_t ssrc) override;
74 void LogBwePacketLossEvent(int32_t bitrate, 77 void LogBwePacketLossEvent(int32_t bitrate,
(...skipping 210 matching lines...) Expand 10 before | Expand all | Expand 10 after
285 sender_config->add_rtx_ssrcs(rtx_ssrc); 288 sender_config->add_rtx_ssrcs(rtx_ssrc);
286 } 289 }
287 sender_config->set_rtx_payload_type(config.rtp.rtx.payload_type); 290 sender_config->set_rtx_payload_type(config.rtp.rtx.payload_type);
288 291
289 rtclog::EncoderConfig* encoder = sender_config->mutable_encoder(); 292 rtclog::EncoderConfig* encoder = sender_config->mutable_encoder();
290 encoder->set_name(config.encoder_settings.payload_name); 293 encoder->set_name(config.encoder_settings.payload_name);
291 encoder->set_payload_type(config.encoder_settings.payload_type); 294 encoder->set_payload_type(config.encoder_settings.payload_type);
292 StoreEvent(&event); 295 StoreEvent(&event);
293 } 296 }
294 297
298 void RtcEventLogImpl::LogAudioReceiveStreamConfig(
299 const AudioReceiveStream::Config& config) {
300 std::unique_ptr<rtclog::Event> event(new rtclog::Event());
301 event->set_timestamp_us(clock_->TimeInMicroseconds());
302 event->set_type(rtclog::Event::AUDIO_RECEIVER_CONFIG_EVENT);
303
304 rtclog::AudioReceiveConfig* receiver_config =
305 event->mutable_audio_receiver_config();
306 receiver_config->set_remote_ssrc(config.rtp.remote_ssrc);
307 receiver_config->set_local_ssrc(config.rtp.local_ssrc);
308
309 for (const auto& e : config.rtp.extensions) {
310 rtclog::RtpHeaderExtension* extension =
311 receiver_config->add_header_extensions();
312 extension->set_name(e.uri);
313 extension->set_id(e.id);
314 }
315 StoreEvent(&event);
316 }
317
318 void RtcEventLogImpl::LogAudioSendStreamConfig(
319 const AudioSendStream::Config& config) {
320 std::unique_ptr<rtclog::Event> event(new rtclog::Event());
321 event->set_timestamp_us(clock_->TimeInMicroseconds());
322 event->set_type(rtclog::Event::AUDIO_SENDER_CONFIG_EVENT);
323
324 rtclog::AudioSendConfig* sender_config = event->mutable_audio_sender_config();
325
326 sender_config->set_ssrc(config.rtp.ssrc);
327
328 for (const auto& e : config.rtp.extensions) {
329 rtclog::RtpHeaderExtension* extension =
330 sender_config->add_header_extensions();
331 extension->set_name(e.uri);
332 extension->set_id(e.id);
333 }
334
335 StoreEvent(&event);
336 }
337
295 void RtcEventLogImpl::LogRtpHeader(PacketDirection direction, 338 void RtcEventLogImpl::LogRtpHeader(PacketDirection direction,
296 MediaType media_type, 339 MediaType media_type,
297 const uint8_t* header, 340 const uint8_t* header,
298 size_t packet_length) { 341 size_t packet_length) {
299 // Read header length (in bytes) from packet data. 342 // Read header length (in bytes) from packet data.
300 if (packet_length < 12u) { 343 if (packet_length < 12u) {
301 return; // Don't read outside the packet. 344 return; // Don't read outside the packet.
302 } 345 }
303 const bool x = (header[0] & 0x10) != 0; 346 const bool x = (header[0] & 0x10) != 0;
304 const uint8_t cc = header[0] & 0x0f; 347 const uint8_t cc = header[0] & 0x0f;
(...skipping 130 matching lines...) Expand 10 before | Expand all | Expand 10 after
435 #else 478 #else
436 return std::unique_ptr<RtcEventLog>(new RtcEventLogNullImpl()); 479 return std::unique_ptr<RtcEventLog>(new RtcEventLogNullImpl());
437 #endif // ENABLE_RTC_EVENT_LOG 480 #endif // ENABLE_RTC_EVENT_LOG
438 } 481 }
439 482
440 std::unique_ptr<RtcEventLog> RtcEventLog::CreateNull() { 483 std::unique_ptr<RtcEventLog> RtcEventLog::CreateNull() {
441 return std::unique_ptr<RtcEventLog>(new RtcEventLogNullImpl()); 484 return std::unique_ptr<RtcEventLog>(new RtcEventLogNullImpl());
442 } 485 }
443 486
444 } // namespace webrtc 487 } // namespace webrtc
OLDNEW
« no previous file with comments | « webrtc/logging/rtc_event_log/rtc_event_log.h ('k') | webrtc/logging/rtc_event_log/rtc_event_log_parser.h » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698