OLD | NEW |
1 /* | 1 /* |
2 * Copyright (c) 2013 The WebRTC project authors. All Rights Reserved. | 2 * Copyright (c) 2013 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 #include <algorithm> | 10 #include <algorithm> |
(...skipping 530 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
541 send_transport_receiver_ = send_transport_receiver; | 541 send_transport_receiver_ = send_transport_receiver; |
542 test::RtpRtcpObserver::SetReceivers(this, receive_transport_receiver); | 542 test::RtpRtcpObserver::SetReceivers(this, receive_transport_receiver); |
543 } | 543 } |
544 | 544 |
545 DeliveryStatus DeliverPacket(MediaType media_type, | 545 DeliveryStatus DeliverPacket(MediaType media_type, |
546 const uint8_t* packet, | 546 const uint8_t* packet, |
547 size_t length, | 547 size_t length, |
548 const PacketTime& packet_time) override { | 548 const PacketTime& packet_time) override { |
549 VideoSendStream::Stats stats = send_stream_->GetStats(); | 549 VideoSendStream::Stats stats = send_stream_->GetStats(); |
550 if (stats.substreams.size() > 0) { | 550 if (stats.substreams.size() > 0) { |
551 DCHECK_EQ(1u, stats.substreams.size()); | 551 RTC_DCHECK_EQ(1u, stats.substreams.size()); |
552 int bitrate_kbps = | 552 int bitrate_kbps = |
553 stats.substreams.begin()->second.total_bitrate_bps / 1000; | 553 stats.substreams.begin()->second.total_bitrate_bps / 1000; |
554 if (bitrate_kbps > 0) { | 554 if (bitrate_kbps > 0) { |
555 test::PrintResult( | 555 test::PrintResult( |
556 "bitrate_stats_", | 556 "bitrate_stats_", |
557 (pad_to_min_bitrate_ ? "min_transmit_bitrate" | 557 (pad_to_min_bitrate_ ? "min_transmit_bitrate" |
558 : "without_min_transmit_bitrate"), | 558 : "without_min_transmit_bitrate"), |
559 "bitrate_kbps", | 559 "bitrate_kbps", |
560 static_cast<size_t>(bitrate_kbps), | 560 static_cast<size_t>(bitrate_kbps), |
561 "kbps", | 561 "kbps", |
(...skipping 26 matching lines...) Expand all Loading... |
588 const std::vector<VideoReceiveStream*>& receive_streams) override { | 588 const std::vector<VideoReceiveStream*>& receive_streams) override { |
589 send_stream_ = send_stream; | 589 send_stream_ = send_stream; |
590 } | 590 } |
591 | 591 |
592 void ModifyConfigs(VideoSendStream::Config* send_config, | 592 void ModifyConfigs(VideoSendStream::Config* send_config, |
593 std::vector<VideoReceiveStream::Config>* receive_configs, | 593 std::vector<VideoReceiveStream::Config>* receive_configs, |
594 VideoEncoderConfig* encoder_config) override { | 594 VideoEncoderConfig* encoder_config) override { |
595 if (pad_to_min_bitrate_) { | 595 if (pad_to_min_bitrate_) { |
596 encoder_config->min_transmit_bitrate_bps = kMinTransmitBitrateBps; | 596 encoder_config->min_transmit_bitrate_bps = kMinTransmitBitrateBps; |
597 } else { | 597 } else { |
598 DCHECK_EQ(0, encoder_config->min_transmit_bitrate_bps); | 598 RTC_DCHECK_EQ(0, encoder_config->min_transmit_bitrate_bps); |
599 } | 599 } |
600 } | 600 } |
601 | 601 |
602 void PerformTest() override { | 602 void PerformTest() override { |
603 EXPECT_EQ(kEventSignaled, Wait()) | 603 EXPECT_EQ(kEventSignaled, Wait()) |
604 << "Timeout while waiting for send-bitrate stats."; | 604 << "Timeout while waiting for send-bitrate stats."; |
605 } | 605 } |
606 | 606 |
607 VideoSendStream* send_stream_; | 607 VideoSendStream* send_stream_; |
608 PacketReceiver* send_transport_receiver_; | 608 PacketReceiver* send_transport_receiver_; |
(...skipping 94 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
703 int encoder_inits_; | 703 int encoder_inits_; |
704 uint32_t last_set_bitrate_; | 704 uint32_t last_set_bitrate_; |
705 VideoSendStream* send_stream_; | 705 VideoSendStream* send_stream_; |
706 VideoEncoderConfig encoder_config_; | 706 VideoEncoderConfig encoder_config_; |
707 } test; | 707 } test; |
708 | 708 |
709 RunBaseTest(&test); | 709 RunBaseTest(&test); |
710 } | 710 } |
711 | 711 |
712 } // namespace webrtc | 712 } // namespace webrtc |
OLD | NEW |