aboutsummaryrefslogtreecommitdiff
path: root/webrtc/modules/bitrate_controller/include/bitrate_allocator.h
diff options
context:
space:
mode:
authorPeter Boström <pbos@webrtc.org>2015-09-15 15:08:03 +0200
committerPeter Boström <pbos@webrtc.org>2015-09-15 13:08:12 +0000
commit8e4e8b045523efb4d4d3416cc17ddb3d1705e41d (patch)
tree4083ab42e9bf3f5f95967a7f2d0689a87ee30701 /webrtc/modules/bitrate_controller/include/bitrate_allocator.h
parentdcb89988216916aebd479aec20798868ea093716 (diff)
downloadwebrtc-8e4e8b045523efb4d4d3416cc17ddb3d1705e41d.tar.gz
Simplify BitrateAllocator::AddBitrateObserver.
Remove start_bitrate_bps which is no longer used and return the current allocated bitrate instead of having it as an out parameter, removing the previous return value which is no longer used. Permits removing bitrate controller usage from ViEEncoder. BUG=webrtc:1695 R=stefan@webrtc.org Review URL: https://codereview.webrtc.org/1343783006 . Cr-Commit-Position: refs/heads/master@{#9942}
Diffstat (limited to 'webrtc/modules/bitrate_controller/include/bitrate_allocator.h')
-rw-r--r--webrtc/modules/bitrate_controller/include/bitrate_allocator.h31
1 files changed, 12 insertions, 19 deletions
diff --git a/webrtc/modules/bitrate_controller/include/bitrate_allocator.h b/webrtc/modules/bitrate_controller/include/bitrate_allocator.h
index 9cc4b74711..5c58f569d2 100644
--- a/webrtc/modules/bitrate_controller/include/bitrate_allocator.h
+++ b/webrtc/modules/bitrate_controller/include/bitrate_allocator.h
@@ -37,15 +37,13 @@ class BitrateAllocator {
// Set the start and max send bitrate used by the bandwidth management.
//
- // observer, updates bitrates if already in use.
- // min_bitrate_bps = 0 equals no min bitrate.
- // max_bitrate_bps = 0 equals no max bitrate.
- // TODO(holmer): Remove start_bitrate_bps when old API is gone.
+ // |observer| updates bitrates if already in use.
+ // |min_bitrate_bps| = 0 equals no min bitrate.
+ // |max_bitrate_bps| = 0 equals no max bitrate.
+ // Returns bitrate allocated for the bitrate observer.
int AddBitrateObserver(BitrateObserver* observer,
- uint32_t start_bitrate_bps,
uint32_t min_bitrate_bps,
- uint32_t max_bitrate_bps,
- int* new_observer_bitrate_bps);
+ uint32_t max_bitrate_bps);
void RemoveBitrateObserver(BitrateObserver* observer);
@@ -61,21 +59,16 @@ class BitrateAllocator {
private:
struct BitrateConfiguration {
- BitrateConfiguration(uint32_t start_bitrate,
- uint32_t min_bitrate,
- uint32_t max_bitrate)
- : start_bitrate_(start_bitrate),
- min_bitrate_(min_bitrate),
- max_bitrate_(max_bitrate) {}
- uint32_t start_bitrate_;
- uint32_t min_bitrate_;
- uint32_t max_bitrate_;
+ BitrateConfiguration(uint32_t min_bitrate, uint32_t max_bitrate)
+ : min_bitrate(min_bitrate), max_bitrate(max_bitrate) {}
+ uint32_t min_bitrate;
+ uint32_t max_bitrate;
};
struct ObserverConfiguration {
ObserverConfiguration(BitrateObserver* observer, uint32_t bitrate)
- : observer_(observer), min_bitrate_(bitrate) {}
- BitrateObserver* observer_;
- uint32_t min_bitrate_;
+ : observer(observer), min_bitrate(bitrate) {}
+ BitrateObserver* const observer;
+ uint32_t min_bitrate;
};
typedef std::pair<BitrateObserver*, BitrateConfiguration>
BitrateObserverConfiguration;