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

Unified Diff: webrtc/call/bitrate_allocator.h

Issue 1785283002: Move BitrateAllocator reference from ViEEncoder to VideoSendStream. (Closed) Base URL: https://chromium.googlesource.com/external/webrtc.git@master
Patch Set: Comment changes. Created 4 years, 9 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
« no previous file with comments | « no previous file | webrtc/call/bitrate_allocator.cc » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: webrtc/call/bitrate_allocator.h
diff --git a/webrtc/call/bitrate_allocator.h b/webrtc/call/bitrate_allocator.h
index 5028e124bdfc0f1463669d6e665587182948f816..25ca735585adc6b6b6f06cb8417a7d641aaa9e0a 100644
--- a/webrtc/call/bitrate_allocator.h
+++ b/webrtc/call/bitrate_allocator.h
@@ -6,10 +6,6 @@
* tree. An additional intellectual property rights grant can be found
* in the file PATENTS. All contributing project authors may
* be found in the AUTHORS file in the root of the source tree.
- *
- * Usage: this class will register multiple RtcpBitrateObserver's one at each
- * RTCP module. It will aggregate the results and run one bandwidth estimation
- * and push the result to the encoders via BitrateObserver(s).
*/
#ifndef WEBRTC_CALL_BITRATE_ALLOCATOR_H_
@@ -25,13 +21,26 @@
namespace webrtc {
-class BitrateObserver;
+// Used by all send streams with adaptive bitrate, to get the currently
+// allocated bitrate for the send stream. The current network properties are
+// given at the same time, to let the send stream decide about possible loss
+// protection.
+class BitrateAllocatorObserver {
+ public:
+ virtual void OnBitrateUpdated(uint32_t bitrate_bps,
+ uint8_t fraction_loss,
+ int64_t rtt) = 0;
+ virtual ~BitrateAllocatorObserver() {}
+};
+// Usage: this class will register multiple RtcpBitrateObserver's one at each
+// RTCP module. It will aggregate the results and run one bandwidth estimation
+// and push the result to the encoders via BitrateAllocatorObserver(s).
class BitrateAllocator {
public:
BitrateAllocator();
- // Allocate target_bitrate across the registered BitrateObservers.
+ // Allocate target_bitrate across the registered BitrateAllocatorObservers.
// Returns actual bitrate allocated (might be higher than target_bitrate if
// for instance EnforceMinBitrate() is enabled.
uint32_t OnNetworkChanged(uint32_t target_bitrate,
@@ -44,11 +53,11 @@ class BitrateAllocator {
// |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 min_bitrate_bps,
- uint32_t max_bitrate_bps);
+ int AddObserver(BitrateAllocatorObserver* observer,
+ uint32_t min_bitrate_bps,
+ uint32_t max_bitrate_bps);
- void RemoveBitrateObserver(BitrateObserver* observer);
+ void RemoveObserver(BitrateAllocatorObserver* observer);
void GetMinMaxBitrateSumBps(int* min_bitrate_sum_bps,
int* max_bitrate_sum_bps) const;
@@ -68,19 +77,20 @@ class BitrateAllocator {
uint32_t max_bitrate;
};
struct ObserverConfiguration {
- ObserverConfiguration(BitrateObserver* observer, uint32_t bitrate)
+ ObserverConfiguration(BitrateAllocatorObserver* observer, uint32_t bitrate)
: observer(observer), min_bitrate(bitrate) {}
- BitrateObserver* const observer;
+ BitrateAllocatorObserver* const observer;
uint32_t min_bitrate;
};
- typedef std::pair<BitrateObserver*, BitrateConfiguration>
+ typedef std::pair<BitrateAllocatorObserver*, BitrateConfiguration>
BitrateObserverConfiguration;
typedef std::list<BitrateObserverConfiguration> BitrateObserverConfList;
typedef std::multimap<uint32_t, ObserverConfiguration> ObserverSortingMap;
- typedef std::map<BitrateObserver*, int> ObserverBitrateMap;
+ typedef std::map<BitrateAllocatorObserver*, int> ObserverBitrateMap;
BitrateObserverConfList::iterator FindObserverConfigurationPair(
- const BitrateObserver* observer) EXCLUSIVE_LOCKS_REQUIRED(crit_sect_);
+ const BitrateAllocatorObserver* observer)
+ EXCLUSIVE_LOCKS_REQUIRED(crit_sect_);
ObserverBitrateMap AllocateBitrates() EXCLUSIVE_LOCKS_REQUIRED(crit_sect_);
ObserverBitrateMap NormalRateAllocation(uint32_t bitrate,
uint32_t sum_min_bitrates)
« no previous file with comments | « no previous file | webrtc/call/bitrate_allocator.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698