OLD | NEW |
1 /* | 1 /* |
2 * Copyright (c) 2012 The WebRTC project authors. All Rights Reserved. | 2 * Copyright (c) 2012 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 614 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
625 uint32_t get_sum_bps() const { return sum_; } // Sum of all bitrates. | 625 uint32_t get_sum_bps() const { return sum_; } // Sum of all bitrates. |
626 uint32_t get_sum_kbps() const { return (sum_ + 500) / 1000; } | 626 uint32_t get_sum_kbps() const { return (sum_ + 500) / 1000; } |
627 | 627 |
628 inline bool operator==(const BitrateAllocation& other) const { | 628 inline bool operator==(const BitrateAllocation& other) const { |
629 return memcmp(bitrates_, other.bitrates_, sizeof(bitrates_)) == 0; | 629 return memcmp(bitrates_, other.bitrates_, sizeof(bitrates_)) == 0; |
630 } | 630 } |
631 inline bool operator!=(const BitrateAllocation& other) const { | 631 inline bool operator!=(const BitrateAllocation& other) const { |
632 return !(*this == other); | 632 return !(*this == other); |
633 } | 633 } |
634 | 634 |
| 635 // Expensive, please use only in tests. |
| 636 std::string ToString() const; |
| 637 std::ostream& operator<<(std::ostream& os) const; |
| 638 |
635 private: | 639 private: |
636 uint32_t sum_; | 640 uint32_t sum_; |
637 uint32_t bitrates_[kMaxSpatialLayers][kMaxTemporalStreams]; | 641 uint32_t bitrates_[kMaxSpatialLayers][kMaxTemporalStreams]; |
638 }; | 642 }; |
639 | 643 |
640 // Bandwidth over-use detector options. These are used to drive | 644 // Bandwidth over-use detector options. These are used to drive |
641 // experimentation with bandwidth estimation parameters. | 645 // experimentation with bandwidth estimation parameters. |
642 // See modules/remote_bitrate_estimator/overuse_detector.h | 646 // See modules/remote_bitrate_estimator/overuse_detector.h |
643 // TODO(terelius): This is only used in overuse_estimator.cc, and only in the | 647 // TODO(terelius): This is only used in overuse_estimator.cc, and only in the |
644 // default constructed state. Can we move the relevant variables into that | 648 // default constructed state. Can we move the relevant variables into that |
(...skipping 243 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
888 enum class RtcpMode { kOff, kCompound, kReducedSize }; | 892 enum class RtcpMode { kOff, kCompound, kReducedSize }; |
889 | 893 |
890 enum NetworkState { | 894 enum NetworkState { |
891 kNetworkUp, | 895 kNetworkUp, |
892 kNetworkDown, | 896 kNetworkDown, |
893 }; | 897 }; |
894 | 898 |
895 } // namespace webrtc | 899 } // namespace webrtc |
896 | 900 |
897 #endif // WEBRTC_COMMON_TYPES_H_ | 901 #endif // WEBRTC_COMMON_TYPES_H_ |
OLD | NEW |