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

Unified Diff: webrtc/call/call.h

Issue 2838233002: Add PeerConnectionInterface::UpdateCallBitrate with call tests. (Closed)
Patch Set: Style/test coverage feedback. No clamping yet. 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 caf0ee2d881951e5c28320086b6cf74c2c48ef92..8058642311119a3d7bedaafe1dea0845e6021803 100644
--- a/webrtc/call/call.h
+++ b/webrtc/call/call.h
@@ -10,9 +10,11 @@
#ifndef WEBRTC_CALL_CALL_H_
#define WEBRTC_CALL_CALL_H_
+#include <memory>
#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"
@@ -20,6 +22,7 @@
#include "webrtc/call/audio_send_stream.h"
#include "webrtc/call/audio_state.h"
#include "webrtc/call/flexfec_receive_stream.h"
+#include "webrtc/call/rtp_transport_controller_send.h"
#include "webrtc/common_types.h"
#include "webrtc/video_receive_stream.h"
#include "webrtc/video_send_stream.h"
@@ -73,6 +76,14 @@ class Call {
int max_bitrate_bps = -1;
} bitrate_config;
+ // TODO(zstein): Consider using PeerConnectionInterface::BitrateParameters
+ // instead (and move BitrateParameters to its own file in api/).
+ 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;
@@ -98,6 +109,11 @@ class Call {
static Call* Create(const Call::Config& config);
+ // Allows mocking |transport_send| for testing.
+ static Call* Create(
+ const Call::Config& config,
+ std::unique_ptr<RtpTransportControllerSendInterface> transport_send);
+
virtual AudioSendStream* CreateAudioSendStream(
const AudioSendStream::Config& config) = 0;
virtual void DestroyAudioSendStream(AudioSendStream* send_stream) = 0;
@@ -134,14 +150,20 @@ 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
+ // The min and start values will only be used if they are not set by
+ // SetBitrateConfigMask. The minimum max set by the two calls 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.
virtual void SetBitrateConfig(
const Config::BitrateConfig& bitrate_config) = 0;
+ // The min and start values set here are preferred to values set by
+ // SetBitrateConfig. The minimum of the max set by the two calls will be used.
+ // Assumes 0 <= min <= start <= max holds for set parameters.
+ virtual RTCError 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