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

Side by Side 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, 6 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 unified diff | Download patch
OLDNEW
1 /* 1 /*
2 * Copyright (c) 2013 The WebRTC project authors. All Rights Reserved. 2 * Copyright (c) 2013 The WebRTC project authors. All Rights Reserved.
3 * 3 *
4 * Use of this source code is governed by a BSD-style license 4 * Use of this source code is governed by a BSD-style license
5 * that can be found in the LICENSE file in the root of the source 5 * that can be found in the LICENSE file in the root of the source
6 * tree. An additional intellectual property rights grant can be found 6 * tree. An additional intellectual property rights grant can be found
7 * in the file PATENTS. All contributing project authors may 7 * in the file PATENTS. All contributing project authors may
8 * be found in the AUTHORS file in the root of the source tree. 8 * be found in the AUTHORS file in the root of the source tree.
9 */ 9 */
10 #ifndef WEBRTC_CALL_CALL_H_ 10 #ifndef WEBRTC_CALL_CALL_H_
11 #define WEBRTC_CALL_CALL_H_ 11 #define WEBRTC_CALL_CALL_H_
12 12
13 #include <memory> 13 #include <memory>
14 #include <string> 14 #include <string>
15 #include <vector> 15 #include <vector>
16 16
17 #include "webrtc/api/rtcerror.h"
17 #include "webrtc/base/networkroute.h" 18 #include "webrtc/base/networkroute.h"
18 #include "webrtc/base/platform_file.h" 19 #include "webrtc/base/platform_file.h"
19 #include "webrtc/base/socket.h" 20 #include "webrtc/base/socket.h"
20 #include "webrtc/call/audio_receive_stream.h" 21 #include "webrtc/call/audio_receive_stream.h"
21 #include "webrtc/call/audio_send_stream.h" 22 #include "webrtc/call/audio_send_stream.h"
22 #include "webrtc/call/audio_state.h" 23 #include "webrtc/call/audio_state.h"
23 #include "webrtc/call/flexfec_receive_stream.h" 24 #include "webrtc/call/flexfec_receive_stream.h"
24 #include "webrtc/call/rtp_transport_controller_send_interface.h" 25 #include "webrtc/call/rtp_transport_controller_send_interface.h"
25 #include "webrtc/common_types.h" 26 #include "webrtc/common_types.h"
26 #include "webrtc/video_receive_stream.h" 27 #include "webrtc/video_receive_stream.h"
(...skipping 34 matching lines...) Expand 10 before | Expand all | Expand 10 after
61 class Call { 62 class Call {
62 public: 63 public:
63 struct Config { 64 struct Config {
64 explicit Config(RtcEventLog* event_log) : event_log(event_log) { 65 explicit Config(RtcEventLog* event_log) : event_log(event_log) {
65 RTC_DCHECK(event_log); 66 RTC_DCHECK(event_log);
66 } 67 }
67 68
68 static const int kDefaultStartBitrateBps; 69 static const int kDefaultStartBitrateBps;
69 70
70 // Bitrate config used until valid bitrate estimates are calculated. Also 71 // Bitrate config used until valid bitrate estimates are calculated. Also
71 // used to cap total bitrate used. 72 // used to cap total bitrate used. This comes from the remote connection.
72 struct BitrateConfig { 73 struct BitrateConfig {
73 int min_bitrate_bps = 0; 74 int min_bitrate_bps = 0;
74 int start_bitrate_bps = kDefaultStartBitrateBps; 75 int start_bitrate_bps = kDefaultStartBitrateBps;
75 int max_bitrate_bps = -1; 76 int max_bitrate_bps = -1;
76 } bitrate_config; 77 } bitrate_config;
77 78
79 // The local client's bitrate preferences. The actual configuration used
80 // is a combination of this and |bitrate_config|. The combination is
81 // currently more complicated than a simple mask operation (see
82 // SetBitrateConfig and SetBitrateConfigMask). Assumes that 0 <= min <=
83 // start <= max holds for set parameters.
84 struct BitrateConfigMask {
85 rtc::Optional<int> min_bitrate_bps;
86 rtc::Optional<int> start_bitrate_bps;
87 rtc::Optional<int> max_bitrate_bps;
88 };
89
78 // AudioState which is possibly shared between multiple calls. 90 // AudioState which is possibly shared between multiple calls.
79 // TODO(solenberg): Change this to a shared_ptr once we can use C++11. 91 // TODO(solenberg): Change this to a shared_ptr once we can use C++11.
80 rtc::scoped_refptr<AudioState> audio_state; 92 rtc::scoped_refptr<AudioState> audio_state;
81 93
82 // Audio Processing Module to be used in this call. 94 // Audio Processing Module to be used in this call.
83 // TODO(solenberg): Change this to a shared_ptr once we can use C++11. 95 // TODO(solenberg): Change this to a shared_ptr once we can use C++11.
84 AudioProcessing* audio_processing = nullptr; 96 AudioProcessing* audio_processing = nullptr;
85 97
86 // RtcEventLog to use for this call. Required. 98 // RtcEventLog to use for this call. Required.
87 // Use webrtc::RtcEventLog::CreateNull() for a null implementation. 99 // Use webrtc::RtcEventLog::CreateNull() for a null implementation.
(...skipping 46 matching lines...) Expand 10 before | Expand all | Expand 10 after
134 146
135 // All received RTP and RTCP packets for the call should be inserted to this 147 // All received RTP and RTCP packets for the call should be inserted to this
136 // PacketReceiver. The PacketReceiver pointer is valid as long as the 148 // PacketReceiver. The PacketReceiver pointer is valid as long as the
137 // Call instance exists. 149 // Call instance exists.
138 virtual PacketReceiver* Receiver() = 0; 150 virtual PacketReceiver* Receiver() = 0;
139 151
140 // Returns the call statistics, such as estimated send and receive bandwidth, 152 // Returns the call statistics, such as estimated send and receive bandwidth,
141 // pacing delay, etc. 153 // pacing delay, etc.
142 virtual Stats GetStats() const = 0; 154 virtual Stats GetStats() const = 0;
143 155
144 // TODO(pbos): Like BitrateConfig above this is currently per-stream instead 156 // The greater min and smaller max set by this and SetBitrateConfigMask will
145 // of maximum for entire Call. This should be fixed along with the above. 157 // be used. The latest non-negative start value from either call will be used.
146 // Specifying a start bitrate (>0) will currently reset the current bitrate 158 // Specifying a start bitrate (>0) will reset the current bitrate estimate.
147 // estimate. This is due to how the 'x-google-start-bitrate' flag is currently 159 // This is due to how the 'x-google-start-bitrate' flag is currently
148 // implemented. 160 // implemented. Passing -1 leaves the start bitrate unchanged. Behavior is not
161 // guaranteed for other negative values or 0.
149 virtual void SetBitrateConfig( 162 virtual void SetBitrateConfig(
150 const Config::BitrateConfig& bitrate_config) = 0; 163 const Config::BitrateConfig& bitrate_config) = 0;
151 164
165 // The greater min and smaller max set by this and SetBitrateConfig will be
166 // used. The latest non-negative start value form either call will be used.
167 // Specifying a start bitrate will reset the current bitrate estimate.
168 // Assumes 0 <= min <= start <= max holds for set parameters.
169 virtual void SetBitrateConfigMask(
170 const Config::BitrateConfigMask& bitrate_mask) = 0;
171
152 // TODO(skvlad): When the unbundled case with multiple streams for the same 172 // TODO(skvlad): When the unbundled case with multiple streams for the same
153 // media type going over different networks is supported, track the state 173 // media type going over different networks is supported, track the state
154 // for each stream separately. Right now it's global per media type. 174 // for each stream separately. Right now it's global per media type.
155 virtual void SignalChannelNetworkState(MediaType media, 175 virtual void SignalChannelNetworkState(MediaType media,
156 NetworkState state) = 0; 176 NetworkState state) = 0;
157 177
158 virtual void OnTransportOverheadChanged( 178 virtual void OnTransportOverheadChanged(
159 MediaType media, 179 MediaType media,
160 int transport_overhead_per_packet) = 0; 180 int transport_overhead_per_packet) = 0;
161 181
162 virtual void OnNetworkRouteChanged( 182 virtual void OnNetworkRouteChanged(
163 const std::string& transport_name, 183 const std::string& transport_name,
164 const rtc::NetworkRoute& network_route) = 0; 184 const rtc::NetworkRoute& network_route) = 0;
165 185
166 virtual void OnSentPacket(const rtc::SentPacket& sent_packet) = 0; 186 virtual void OnSentPacket(const rtc::SentPacket& sent_packet) = 0;
167 187
168 virtual ~Call() {} 188 virtual ~Call() {}
169 }; 189 };
170 190
171 } // namespace webrtc 191 } // namespace webrtc
172 192
173 #endif // WEBRTC_CALL_CALL_H_ 193 #endif // WEBRTC_CALL_CALL_H_
OLDNEW
« 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