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 45 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
56 public: | 56 public: |
57 RtcEventLogImpl(); | 57 RtcEventLogImpl(); |
58 ~RtcEventLogImpl() override; | 58 ~RtcEventLogImpl() override; |
59 | 59 |
60 bool StartLogging(const std::string& file_name, | 60 bool StartLogging(const std::string& file_name, |
61 int64_t max_size_bytes) override; | 61 int64_t max_size_bytes) override; |
62 bool StartLogging(rtc::PlatformFile platform_file, | 62 bool StartLogging(rtc::PlatformFile platform_file, |
63 int64_t max_size_bytes) override; | 63 int64_t max_size_bytes) override; |
64 void StopLogging() override; | 64 void StopLogging() override; |
65 void LogVideoReceiveStreamConfig(const rtclog::StreamConfig& config) override; | 65 void LogVideoReceiveStreamConfig(const rtclog::StreamConfig& config) override; |
66 void LogVideoSendStreamConfig(const VideoSendStream::Config& config) override; | 66 void LogVideoSendStreamConfig(const rtclog::StreamConfig& config) override; |
67 void LogAudioReceiveStreamConfig( | 67 void LogAudioReceiveStreamConfig( |
68 const AudioReceiveStream::Config& config) override; | 68 const AudioReceiveStream::Config& config) override; |
69 void LogAudioSendStreamConfig(const AudioSendStream::Config& config) override; | 69 void LogAudioSendStreamConfig(const AudioSendStream::Config& config) override; |
70 void LogRtpHeader(PacketDirection direction, | 70 void LogRtpHeader(PacketDirection direction, |
71 MediaType media_type, | 71 MediaType media_type, |
72 const uint8_t* header, | 72 const uint8_t* header, |
73 size_t packet_length) override; | 73 size_t packet_length) override; |
74 void LogRtpHeader(PacketDirection direction, | 74 void LogRtpHeader(PacketDirection direction, |
75 MediaType media_type, | 75 MediaType media_type, |
76 const uint8_t* header, | 76 const uint8_t* header, |
(...skipping 228 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
305 rtclog::RtxMap* rtx = receiver_config->add_rtx_map(); | 305 rtclog::RtxMap* rtx = receiver_config->add_rtx_map(); |
306 rtx->set_payload_type(d.payload_type); | 306 rtx->set_payload_type(d.payload_type); |
307 rtx->mutable_config()->set_rtx_ssrc(config.rtx_ssrc); | 307 rtx->mutable_config()->set_rtx_ssrc(config.rtx_ssrc); |
308 rtx->mutable_config()->set_rtx_payload_type(d.rtx_payload_type); | 308 rtx->mutable_config()->set_rtx_payload_type(d.rtx_payload_type); |
309 } | 309 } |
310 } | 310 } |
311 StoreEvent(&event); | 311 StoreEvent(&event); |
312 } | 312 } |
313 | 313 |
314 void RtcEventLogImpl::LogVideoSendStreamConfig( | 314 void RtcEventLogImpl::LogVideoSendStreamConfig( |
315 const VideoSendStream::Config& config) { | 315 const rtclog::StreamConfig& config) { |
316 std::unique_ptr<rtclog::Event> event(new rtclog::Event()); | 316 std::unique_ptr<rtclog::Event> event(new rtclog::Event()); |
317 event->set_timestamp_us(rtc::TimeMicros()); | 317 event->set_timestamp_us(rtc::TimeMicros()); |
318 event->set_type(rtclog::Event::VIDEO_SENDER_CONFIG_EVENT); | 318 event->set_type(rtclog::Event::VIDEO_SENDER_CONFIG_EVENT); |
319 | 319 |
320 rtclog::VideoSendConfig* sender_config = event->mutable_video_sender_config(); | 320 rtclog::VideoSendConfig* sender_config = event->mutable_video_sender_config(); |
321 | 321 |
322 for (const auto& ssrc : config.rtp.ssrcs) { | 322 // TODO(perkj): rtclog::VideoSendConfig should only contain one SSRC. |
323 sender_config->add_ssrcs(ssrc); | 323 sender_config->add_ssrcs(config.local_ssrc); |
| 324 if (config.rtx_ssrc != 0) { |
| 325 sender_config->add_rtx_ssrcs(config.rtx_ssrc); |
324 } | 326 } |
325 | 327 |
326 for (const auto& e : config.rtp.extensions) { | 328 for (const auto& e : config.rtp_extensions) { |
327 rtclog::RtpHeaderExtension* extension = | 329 rtclog::RtpHeaderExtension* extension = |
328 sender_config->add_header_extensions(); | 330 sender_config->add_header_extensions(); |
329 extension->set_name(e.uri); | 331 extension->set_name(e.uri); |
330 extension->set_id(e.id); | 332 extension->set_id(e.id); |
331 } | 333 } |
332 | 334 |
333 for (const auto& rtx_ssrc : config.rtp.rtx.ssrcs) { | 335 // TODO(perkj): rtclog::VideoSendConfig should contain many possible codec |
334 sender_config->add_rtx_ssrcs(rtx_ssrc); | 336 // configurations. |
| 337 for (const auto& codec : config.codecs) { |
| 338 sender_config->set_rtx_payload_type(codec.rtx_payload_type); |
| 339 rtclog::EncoderConfig* encoder = sender_config->mutable_encoder(); |
| 340 encoder->set_name(codec.payload_name); |
| 341 encoder->set_payload_type(codec.payload_type); |
| 342 |
| 343 if (config.codecs.size() > 1) { |
| 344 LOG(WARNING) << "LogVideoSendStreamConfig currently only supports one " |
| 345 << "codec. Logging codec :" << codec.payload_name; |
| 346 break; |
| 347 } |
335 } | 348 } |
336 sender_config->set_rtx_payload_type(config.rtp.rtx.payload_type); | |
337 | 349 |
338 rtclog::EncoderConfig* encoder = sender_config->mutable_encoder(); | |
339 encoder->set_name(config.encoder_settings.payload_name); | |
340 encoder->set_payload_type(config.encoder_settings.payload_type); | |
341 StoreEvent(&event); | 350 StoreEvent(&event); |
342 } | 351 } |
343 | 352 |
344 void RtcEventLogImpl::LogAudioReceiveStreamConfig( | 353 void RtcEventLogImpl::LogAudioReceiveStreamConfig( |
345 const AudioReceiveStream::Config& config) { | 354 const AudioReceiveStream::Config& config) { |
346 std::unique_ptr<rtclog::Event> event(new rtclog::Event()); | 355 std::unique_ptr<rtclog::Event> event(new rtclog::Event()); |
347 event->set_timestamp_us(rtc::TimeMicros()); | 356 event->set_timestamp_us(rtc::TimeMicros()); |
348 event->set_type(rtclog::Event::AUDIO_RECEIVER_CONFIG_EVENT); | 357 event->set_type(rtclog::Event::AUDIO_RECEIVER_CONFIG_EVENT); |
349 | 358 |
350 rtclog::AudioReceiveConfig* receiver_config = | 359 rtclog::AudioReceiveConfig* receiver_config = |
(...skipping 262 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
613 #else | 622 #else |
614 return std::unique_ptr<RtcEventLog>(new RtcEventLogNullImpl()); | 623 return std::unique_ptr<RtcEventLog>(new RtcEventLogNullImpl()); |
615 #endif // ENABLE_RTC_EVENT_LOG | 624 #endif // ENABLE_RTC_EVENT_LOG |
616 } | 625 } |
617 | 626 |
618 std::unique_ptr<RtcEventLog> RtcEventLog::CreateNull() { | 627 std::unique_ptr<RtcEventLog> RtcEventLog::CreateNull() { |
619 return std::unique_ptr<RtcEventLog>(new RtcEventLogNullImpl()); | 628 return std::unique_ptr<RtcEventLog>(new RtcEventLogNullImpl()); |
620 } | 629 } |
621 | 630 |
622 } // namespace webrtc | 631 } // namespace webrtc |
OLD | NEW |