| OLD | NEW |
| 1 /* | 1 /* |
| 2 * Copyright (c) 2016 The WebRTC project authors. All Rights Reserved. | 2 * Copyright (c) 2016 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 360 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 371 } else { | 371 } else { |
| 372 config->rtx_ssrc = rtx_it->second.rtx_ssrc(); | 372 config->rtx_ssrc = rtx_it->second.rtx_ssrc(); |
| 373 } | 373 } |
| 374 } | 374 } |
| 375 config->codecs.emplace_back(receiver_config.decoders(i).name(), | 375 config->codecs.emplace_back(receiver_config.decoders(i).name(), |
| 376 receiver_config.decoders(i).payload_type(), | 376 receiver_config.decoders(i).payload_type(), |
| 377 rtx_payload_type); | 377 rtx_payload_type); |
| 378 } | 378 } |
| 379 } | 379 } |
| 380 | 380 |
| 381 void ParsedRtcEventLog::GetVideoSendConfig( | 381 void ParsedRtcEventLog::GetVideoSendConfig(size_t index, |
| 382 size_t index, | 382 rtclog::StreamConfig* config) const { |
| 383 VideoSendStream::Config* config) const { | |
| 384 RTC_CHECK_LT(index, GetNumberOfEvents()); | 383 RTC_CHECK_LT(index, GetNumberOfEvents()); |
| 385 const rtclog::Event& event = events_[index]; | 384 const rtclog::Event& event = events_[index]; |
| 386 RTC_CHECK(config != nullptr); | 385 RTC_CHECK(config != nullptr); |
| 387 RTC_CHECK(event.has_type()); | 386 RTC_CHECK(event.has_type()); |
| 388 RTC_CHECK_EQ(event.type(), rtclog::Event::VIDEO_SENDER_CONFIG_EVENT); | 387 RTC_CHECK_EQ(event.type(), rtclog::Event::VIDEO_SENDER_CONFIG_EVENT); |
| 389 RTC_CHECK(event.has_video_sender_config()); | 388 RTC_CHECK(event.has_video_sender_config()); |
| 390 const rtclog::VideoSendConfig& sender_config = event.video_sender_config(); | 389 const rtclog::VideoSendConfig& sender_config = event.video_sender_config(); |
| 391 // Get SSRCs. | 390 // Get SSRCs. |
| 392 config->rtp.ssrcs.clear(); | 391 if (sender_config.ssrcs_size() > 0) { |
| 393 for (int i = 0; i < sender_config.ssrcs_size(); i++) { | 392 config->local_ssrc = sender_config.ssrcs(0); |
| 394 config->rtp.ssrcs.push_back(sender_config.ssrcs(i)); | 393 if (sender_config.ssrcs().size() > 1) { |
| 395 } | 394 LOG(WARNING) << "VideoSendConfig contains multiple ssrcs."; |
| 396 // Get header extensions. | 395 } |
| 397 GetHeaderExtensions(&config->rtp.extensions, | |
| 398 sender_config.header_extensions()); | |
| 399 // Get RTX settings. | |
| 400 config->rtp.rtx.ssrcs.clear(); | |
| 401 for (int i = 0; i < sender_config.rtx_ssrcs_size(); i++) { | |
| 402 config->rtp.rtx.ssrcs.push_back(sender_config.rtx_ssrcs(i)); | |
| 403 } | 396 } |
| 404 if (sender_config.rtx_ssrcs_size() > 0) { | 397 if (sender_config.rtx_ssrcs_size() > 0) { |
| 405 RTC_CHECK(sender_config.has_rtx_payload_type()); | 398 RTC_CHECK(sender_config.has_rtx_payload_type()); |
| 406 config->rtp.rtx.payload_type = sender_config.rtx_payload_type(); | 399 config->rtx_ssrc = sender_config.rtx_ssrcs(0); |
| 407 } else { | 400 if (sender_config.rtx_ssrcs_size() > 1) { |
| 408 // Reset RTX payload type default value if no RTX SSRCs are used. | 401 LOG(WARNING) << "VideoSendConfig contains multiple rtx ssrcs."; |
| 409 config->rtp.rtx.payload_type = -1; | 402 } |
| 410 } | 403 } |
| 411 // Get encoder. | 404 // Get header extensions. |
| 405 GetHeaderExtensions(&config->rtp_extensions, |
| 406 sender_config.header_extensions()); |
| 407 |
| 408 // Get the codec. |
| 412 RTC_CHECK(sender_config.has_encoder()); | 409 RTC_CHECK(sender_config.has_encoder()); |
| 413 RTC_CHECK(sender_config.encoder().has_name()); | 410 RTC_CHECK(sender_config.encoder().has_name()); |
| 414 RTC_CHECK(sender_config.encoder().has_payload_type()); | 411 RTC_CHECK(sender_config.encoder().has_payload_type()); |
| 415 config->encoder_settings.payload_name = sender_config.encoder().name(); | 412 config->codecs.emplace_back( |
| 416 config->encoder_settings.payload_type = | 413 sender_config.encoder().name(), sender_config.encoder().payload_type(), |
| 417 sender_config.encoder().payload_type(); | 414 sender_config.has_rtx_payload_type() ? sender_config.rtx_payload_type() |
| 415 : 0); |
| 418 } | 416 } |
| 419 | 417 |
| 420 void ParsedRtcEventLog::GetAudioReceiveConfig( | 418 void ParsedRtcEventLog::GetAudioReceiveConfig( |
| 421 size_t index, | 419 size_t index, |
| 422 AudioReceiveStream::Config* config) const { | 420 AudioReceiveStream::Config* config) const { |
| 423 RTC_CHECK_LT(index, GetNumberOfEvents()); | 421 RTC_CHECK_LT(index, GetNumberOfEvents()); |
| 424 const rtclog::Event& event = events_[index]; | 422 const rtclog::Event& event = events_[index]; |
| 425 RTC_CHECK(config != nullptr); | 423 RTC_CHECK(config != nullptr); |
| 426 RTC_CHECK(event.has_type()); | 424 RTC_CHECK(event.has_type()); |
| 427 RTC_CHECK_EQ(event.type(), rtclog::Event::AUDIO_RECEIVER_CONFIG_EVENT); | 425 RTC_CHECK_EQ(event.type(), rtclog::Event::AUDIO_RECEIVER_CONFIG_EVENT); |
| (...skipping 157 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 585 rtc::Optional<ProbeFailureReason>(kInvalidSendReceiveRatio); | 583 rtc::Optional<ProbeFailureReason>(kInvalidSendReceiveRatio); |
| 586 } else if (pr_event.result() == rtclog::BweProbeResult::TIMEOUT) { | 584 } else if (pr_event.result() == rtclog::BweProbeResult::TIMEOUT) { |
| 587 res.failure_reason = rtc::Optional<ProbeFailureReason>(kTimeout); | 585 res.failure_reason = rtc::Optional<ProbeFailureReason>(kTimeout); |
| 588 } else { | 586 } else { |
| 589 RTC_NOTREACHED(); | 587 RTC_NOTREACHED(); |
| 590 } | 588 } |
| 591 | 589 |
| 592 return res; | 590 return res; |
| 593 } | 591 } |
| 594 } // namespace webrtc | 592 } // namespace webrtc |
| OLD | NEW |