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 | 10 |
11 #ifndef WEBRTC_MODULES_REMOTE_BITRATE_ESTIMATOR_TEST_BWE_TEST_FRAMEWORK_H_ | 11 #ifndef WEBRTC_MODULES_REMOTE_BITRATE_ESTIMATOR_TEST_BWE_TEST_FRAMEWORK_H_ |
12 #define WEBRTC_MODULES_REMOTE_BITRATE_ESTIMATOR_TEST_BWE_TEST_FRAMEWORK_H_ | 12 #define WEBRTC_MODULES_REMOTE_BITRATE_ESTIMATOR_TEST_BWE_TEST_FRAMEWORK_H_ |
13 | 13 |
14 #include <assert.h> | 14 #include <assert.h> |
15 #include <math.h> | 15 #include <math.h> |
16 | 16 |
17 #include <algorithm> | 17 #include <algorithm> |
18 #include <list> | 18 #include <list> |
19 #include <numeric> | 19 #include <numeric> |
20 #include <set> | |
20 #include <sstream> | 21 #include <sstream> |
21 #include <string> | 22 #include <string> |
22 #include <vector> | 23 #include <vector> |
24 #include <utility> | |
mflodman
2015/12/14 12:05:36
Alphabetic order.
terelius
2015/12/14 15:28:55
Done.
| |
23 | 25 |
24 #include "webrtc/base/common.h" | 26 #include "webrtc/base/common.h" |
25 #include "webrtc/base/random.h" | 27 #include "webrtc/base/random.h" |
26 #include "webrtc/base/scoped_ptr.h" | 28 #include "webrtc/base/scoped_ptr.h" |
27 #include "webrtc/modules/bitrate_controller/include/bitrate_controller.h" | 29 #include "webrtc/modules/bitrate_controller/include/bitrate_controller.h" |
28 #include "webrtc/modules/include/module_common_types.h" | 30 #include "webrtc/modules/include/module_common_types.h" |
29 #include "webrtc/modules/pacing/paced_sender.h" | 31 #include "webrtc/modules/pacing/paced_sender.h" |
30 #include "webrtc/modules/remote_bitrate_estimator/include/remote_bitrate_estimat or.h" | 32 #include "webrtc/modules/remote_bitrate_estimator/include/remote_bitrate_estimat or.h" |
31 #include "webrtc/modules/remote_bitrate_estimator/test/bwe_test_logging.h" | 33 #include "webrtc/modules/remote_bitrate_estimator/test/bwe_test_logging.h" |
32 #include "webrtc/modules/remote_bitrate_estimator/test/packet.h" | 34 #include "webrtc/modules/remote_bitrate_estimator/test/packet.h" |
33 #include "webrtc/modules/rtp_rtcp/include/rtp_rtcp_defines.h" | 35 #include "webrtc/modules/rtp_rtcp/include/rtp_rtcp_defines.h" |
34 #include "webrtc/system_wrappers/include/clock.h" | 36 #include "webrtc/system_wrappers/include/clock.h" |
35 | 37 |
36 namespace webrtc { | 38 namespace webrtc { |
37 | 39 |
38 class RtcpBandwidthObserver; | 40 class RtcpBandwidthObserver; |
39 | 41 |
40 namespace testing { | 42 namespace testing { |
41 namespace bwe { | 43 namespace bwe { |
42 | 44 |
43 class DelayCapHelper; | 45 class DelayCapHelper; |
44 | 46 |
45 class RateCounter { | 47 class RateCounter { |
46 public: | 48 public: |
47 RateCounter(int64_t window_size_ms) | 49 explicit RateCounter(int64_t window_size_ms) |
48 : window_size_us_(1000 * window_size_ms), | 50 : window_size_us_(1000 * window_size_ms), |
49 recently_received_packets_(0), | 51 recently_received_packets_(0), |
50 recently_received_bytes_(0), | 52 recently_received_bytes_(0), |
51 last_accumulated_us_(0), | 53 last_accumulated_us_(0), |
52 window_() {} | 54 window_() {} |
53 | 55 |
54 RateCounter() : RateCounter(1000) {} | 56 RateCounter() : RateCounter(1000) {} |
55 | 57 |
56 void UpdateRates(int64_t send_time_us, uint32_t payload_size); | 58 void UpdateRates(int64_t send_time_us, uint32_t payload_size); |
57 | 59 |
(...skipping 350 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... | |
408 virtual uint32_t NextPacketSize(uint32_t frame_size, | 410 virtual uint32_t NextPacketSize(uint32_t frame_size, |
409 uint32_t remaining_payload); | 411 uint32_t remaining_payload); |
410 | 412 |
411 const uint32_t kMaxPayloadSizeBytes; | 413 const uint32_t kMaxPayloadSizeBytes; |
412 const uint32_t kTimestampBase; | 414 const uint32_t kTimestampBase; |
413 const double frame_period_ms_; | 415 const double frame_period_ms_; |
414 uint32_t bits_per_second_; | 416 uint32_t bits_per_second_; |
415 uint32_t frame_size_bytes_; | 417 uint32_t frame_size_bytes_; |
416 | 418 |
417 private: | 419 private: |
420 Random random_; | |
418 const int flow_id_; | 421 const int flow_id_; |
419 int64_t next_frame_ms_; | 422 int64_t next_frame_ms_; |
420 int64_t next_frame_rand_ms_; | 423 int64_t next_frame_rand_ms_; |
421 int64_t now_ms_; | 424 int64_t now_ms_; |
422 RTPHeader prototype_header_; | 425 RTPHeader prototype_header_; |
423 | 426 |
424 RTC_DISALLOW_IMPLICIT_CONSTRUCTORS(VideoSource); | 427 RTC_DISALLOW_IMPLICIT_CONSTRUCTORS(VideoSource); |
425 }; | 428 }; |
426 | 429 |
427 class AdaptiveVideoSource : public VideoSource { | 430 class AdaptiveVideoSource : public VideoSource { |
(...skipping 31 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... | |
459 uint32_t frame_counter_; | 462 uint32_t frame_counter_; |
460 int compensation_bytes_; | 463 int compensation_bytes_; |
461 int compensation_per_frame_; | 464 int compensation_per_frame_; |
462 RTC_DISALLOW_IMPLICIT_CONSTRUCTORS(PeriodicKeyFrameSource); | 465 RTC_DISALLOW_IMPLICIT_CONSTRUCTORS(PeriodicKeyFrameSource); |
463 }; | 466 }; |
464 } // namespace bwe | 467 } // namespace bwe |
465 } // namespace testing | 468 } // namespace testing |
466 } // namespace webrtc | 469 } // namespace webrtc |
467 | 470 |
468 #endif // WEBRTC_MODULES_REMOTE_BITRATE_ESTIMATOR_TEST_BWE_TEST_FRAMEWORK_H_ | 471 #endif // WEBRTC_MODULES_REMOTE_BITRATE_ESTIMATOR_TEST_BWE_TEST_FRAMEWORK_H_ |
OLD | NEW |