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

Side by Side Diff: webrtc/modules/remote_bitrate_estimator/test/bwe_test_framework.cc

Issue 1151603008: Make the BWE threshold adaptive. (Closed) Base URL: https://chromium.googlesource.com/external/webrtc.git@master
Patch Set: Improve self-fairness. Created 5 years, 6 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) 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 10
(...skipping 662 matching lines...) Expand 10 before | Expand all | Expand 10 after
673 ++prototype_header_.sequenceNumber; 673 ++prototype_header_.sequenceNumber;
674 uint32_t size = NextPacketSize(frame_size, payload_size); 674 uint32_t size = NextPacketSize(frame_size, payload_size);
675 MediaPacket* new_packet = 675 MediaPacket* new_packet =
676 new MediaPacket(flow_id_, send_time_us, size, prototype_header_); 676 new MediaPacket(flow_id_, send_time_us, size, prototype_header_);
677 new_packets.push_back(new_packet); 677 new_packets.push_back(new_packet);
678 new_packet->SetAbsSendTimeMs(next_frame_ms_); 678 new_packet->SetAbsSendTimeMs(next_frame_ms_);
679 new_packet->set_sender_timestamp_us(send_time_us); 679 new_packet->set_sender_timestamp_us(send_time_us);
680 payload_size -= size; 680 payload_size -= size;
681 } 681 }
682 682
683 next_frame_ms_ += frame_period_ms_; 683 next_frame_ms_ += frame_period_ms_; // + ((rand() % 3) - 2);
684 } 684 }
685 in_out->merge(new_packets, DereferencingComparator<Packet>); 685 in_out->merge(new_packets, DereferencingComparator<Packet>);
686 } 686 }
687 687
688 AdaptiveVideoSource::AdaptiveVideoSource(int flow_id, 688 AdaptiveVideoSource::AdaptiveVideoSource(int flow_id,
689 float fps, 689 float fps,
690 uint32_t kbps, 690 uint32_t kbps,
691 uint32_t ssrc, 691 uint32_t ssrc,
692 int64_t first_frame_offset_ms) 692 int64_t first_frame_offset_ms)
693 : VideoSource(flow_id, fps, kbps, ssrc, first_frame_offset_ms) { 693 : VideoSource(flow_id, fps, kbps, ssrc, first_frame_offset_ms) {
(...skipping 47 matching lines...) Expand 10 before | Expand all | Expand 10 after
741 uint32_t PeriodicKeyFrameSource::NextPacketSize(uint32_t frame_size, 741 uint32_t PeriodicKeyFrameSource::NextPacketSize(uint32_t frame_size,
742 uint32_t remaining_payload) { 742 uint32_t remaining_payload) {
743 uint32_t fragments = 743 uint32_t fragments =
744 (frame_size + (kMaxPayloadSizeBytes - 1)) / kMaxPayloadSizeBytes; 744 (frame_size + (kMaxPayloadSizeBytes - 1)) / kMaxPayloadSizeBytes;
745 uint32_t avg_size = (frame_size + fragments - 1) / fragments; 745 uint32_t avg_size = (frame_size + fragments - 1) / fragments;
746 return std::min(avg_size, remaining_payload); 746 return std::min(avg_size, remaining_payload);
747 } 747 }
748 } // namespace bwe 748 } // namespace bwe
749 } // namespace testing 749 } // namespace testing
750 } // namespace webrtc 750 } // namespace webrtc
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698