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

Unified Diff: webrtc/call/call.h

Issue 2888303005: Add PeerConnectionInterface::UpdateCallBitrate. (Closed)
Patch Set: Implement SetBitrate in PeerConnectionInterface to avoid breaking chromium mock. Created 3 years, 7 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/call/call.h
diff --git a/webrtc/call/call.h b/webrtc/call/call.h
index f67b6907e5f7a1c3465b984dc23de768f6130631..06479890ce151c4d8b667d489aaf7dff2f87e0be 100644
--- a/webrtc/call/call.h
+++ b/webrtc/call/call.h
@@ -14,6 +14,7 @@
#include <string>
#include <vector>
+#include "webrtc/api/rtcerror.h"
#include "webrtc/base/networkroute.h"
#include "webrtc/base/platform_file.h"
#include "webrtc/base/socket.h"
@@ -68,13 +69,24 @@ class Call {
static const int kDefaultStartBitrateBps;
// Bitrate config used until valid bitrate estimates are calculated. Also
- // used to cap total bitrate used.
+ // used to cap total bitrate used. This comes from the remote connection.
struct BitrateConfig {
int min_bitrate_bps = 0;
int start_bitrate_bps = kDefaultStartBitrateBps;
int max_bitrate_bps = -1;
} bitrate_config;
+ // The local client's bitrate preferences. The actual configuration used
+ // is a combination of this and |bitrate_config|. The combination is
+ // currently more complicated than a simple mask operation (see
+ // SetBitrateConfig and SetBitrateConfigMask). Assumes that 0 <= min <=
+ // start <= max holds for set parameters.
+ struct BitrateConfigMask {
+ rtc::Optional<int> min_bitrate_bps;
+ rtc::Optional<int> start_bitrate_bps;
+ rtc::Optional<int> max_bitrate_bps;
+ };
+
// AudioState which is possibly shared between multiple calls.
// TODO(solenberg): Change this to a shared_ptr once we can use C++11.
rtc::scoped_refptr<AudioState> audio_state;
@@ -141,14 +153,22 @@ class Call {
// pacing delay, etc.
virtual Stats GetStats() const = 0;
- // TODO(pbos): Like BitrateConfig above this is currently per-stream instead
- // of maximum for entire Call. This should be fixed along with the above.
- // Specifying a start bitrate (>0) will currently reset the current bitrate
- // estimate. This is due to how the 'x-google-start-bitrate' flag is currently
- // implemented.
+ // The greater min and smaller max set by this and SetBitrateConfigMask will
+ // be used. The latest non-negative start value from either call will be used.
+ // Specifying a start bitrate (>0) will reset the current bitrate estimate.
+ // This is due to how the 'x-google-start-bitrate' flag is currently
+ // implemented. Passing -1 leaves the start bitrate unchanged. Behavior is not
+ // guaranteed for other negative values or 0.
virtual void SetBitrateConfig(
const Config::BitrateConfig& bitrate_config) = 0;
+ // The greater min and smaller max set by this and SetBitrateConfig will be
+ // used. The latest non-negative start value form either call will be used.
+ // Specifying a start bitrate will reset the current bitrate estimate.
+ // Assumes 0 <= min <= start <= max holds for set parameters.
+ virtual void SetBitrateConfigMask(
+ const Config::BitrateConfigMask& bitrate_mask) = 0;
+
// TODO(skvlad): When the unbundled case with multiple streams for the same
// media type going over different networks is supported, track the state
// for each stream separately. Right now it's global per media type.
« no previous file with comments | « webrtc/api/peerconnectionproxy.h ('k') | webrtc/call/call.cc » ('j') | webrtc/call/call.cc » ('J')

Powered by Google App Engine
This is Rietveld 408576698