Refactor in BitrateController module.
- Move condition of 0 bps as max meaning 1gbps from SendSideBandwidthEstimation to BitrateController. - Remove condition on bitrate=0 meaning bandwidth estimation off as that could only happen when no observers existed and in which case the estimation would be ignored. - Add MaybeTriggerOnNetworkChanged which only runs rate allocation if any of the dependent variables has changed thus allowing to remove many of the bool returns that try to indicate if the estimation has changed which would not be aware if the observers have changed. - SendSideBandwidthEstimation now has a UpdateBitrate and has clear code paths to which calls update bitrate. - Changes in enforce_min_bitrate so the 10kbps min is set from the BitrateController and not from the outside this keep valid as observers are changed. R=henrik.lundin@webrtc.org, stefan@webrtc.org BUG=3065 Review URL: https://webrtc-codereview.appspot.com/10189004 git-svn-id: http://webrtc.googlecode.com/svn/trunk@5752 4adac7df-926f-26a2-2b94-8c16560cd09d
This commit is contained in:
@ -45,8 +45,6 @@ class BitrateControllerImpl : public BitrateController {
|
||||
|
||||
virtual void EnforceMinBitrate(bool enforce_min_bitrate) OVERRIDE;
|
||||
|
||||
virtual void SetBweMinBitrate(uint32_t min_bitrate) OVERRIDE;
|
||||
|
||||
private:
|
||||
class RtcpBandwidthObserverImpl;
|
||||
|
||||
@ -75,6 +73,7 @@ class BitrateControllerImpl : public BitrateController {
|
||||
BitrateObserverConfiguration;
|
||||
typedef std::list<BitrateObserverConfiguration> BitrateObserverConfList;
|
||||
|
||||
void UpdateMinMaxBitrate() EXCLUSIVE_LOCKS_REQUIRED(*critsect_);
|
||||
|
||||
// Called by BitrateObserver's direct from the RTCP module.
|
||||
void OnReceivedEstimatedBitrate(const uint32_t bitrate);
|
||||
@ -84,6 +83,8 @@ class BitrateControllerImpl : public BitrateController {
|
||||
const int number_of_packets,
|
||||
const uint32_t now_ms);
|
||||
|
||||
void MaybeTriggerOnNetworkChanged() EXCLUSIVE_LOCKS_REQUIRED(*critsect_);
|
||||
|
||||
void OnNetworkChanged(const uint32_t bitrate,
|
||||
const uint8_t fraction_loss, // 0 - 255.
|
||||
const uint32_t rtt)
|
||||
@ -110,6 +111,11 @@ class BitrateControllerImpl : public BitrateController {
|
||||
SendSideBandwidthEstimation bandwidth_estimation_ GUARDED_BY(*critsect_);
|
||||
BitrateObserverConfList bitrate_observers_ GUARDED_BY(*critsect_);
|
||||
bool enforce_min_bitrate_ GUARDED_BY(*critsect_);
|
||||
uint32_t last_bitrate_ GUARDED_BY(*critsect_);
|
||||
uint8_t last_fraction_loss_ GUARDED_BY(*critsect_);
|
||||
uint32_t last_rtt_ GUARDED_BY(*critsect_);
|
||||
bool last_enforce_min_bitrate_ GUARDED_BY(*critsect_);
|
||||
bool bitrate_observers_modified_ GUARDED_BY(*critsect_);
|
||||
};
|
||||
} // namespace webrtc
|
||||
#endif // WEBRTC_MODULES_BITRATE_CONTROLLER_BITRATE_CONTROLLER_IMPL_H_
|
||||
|
||||
Reference in New Issue
Block a user