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

Unified Diff: webrtc/modules/bitrate_controller/include/bitrate_allocator.h

Issue 1343783006: Simplify BitrateAllocator::AddBitrateObserver. (Closed) Base URL: https://chromium.googlesource.com/external/webrtc.git@master
Patch Set: fix test Created 5 years, 3 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 side-by-side diff with in-line comments
Download patch
Index: webrtc/modules/bitrate_controller/include/bitrate_allocator.h
diff --git a/webrtc/modules/bitrate_controller/include/bitrate_allocator.h b/webrtc/modules/bitrate_controller/include/bitrate_allocator.h
index 9cc4b747116d8580363ce9a55f00d544e873e31b..5c58f569d232699cd33136e3405d7acfe7c7235a 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;

Powered by Google App Engine
This is Rietveld 408576698