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

Side by Side Diff: webrtc/call/call.h

Issue 2793913008: Add PeerConnectionInterface::UpdateCallBitrate. (Closed)
Patch Set: Force update if current bitrate is set. Remove big lambda. Improve parameter validation. Created 3 years, 8 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 <string> 13 #include <string>
14 #include <vector> 14 #include <vector>
15 15
16 #include "webrtc/api/rtcerror.h"
16 #include "webrtc/base/networkroute.h" 17 #include "webrtc/base/networkroute.h"
17 #include "webrtc/base/platform_file.h" 18 #include "webrtc/base/platform_file.h"
18 #include "webrtc/base/socket.h" 19 #include "webrtc/base/socket.h"
19 #include "webrtc/call/audio_receive_stream.h" 20 #include "webrtc/call/audio_receive_stream.h"
20 #include "webrtc/call/audio_send_stream.h" 21 #include "webrtc/call/audio_send_stream.h"
21 #include "webrtc/call/audio_state.h" 22 #include "webrtc/call/audio_state.h"
22 #include "webrtc/call/flexfec_receive_stream.h" 23 #include "webrtc/call/flexfec_receive_stream.h"
23 #include "webrtc/common_types.h" 24 #include "webrtc/common_types.h"
24 #include "webrtc/video_receive_stream.h" 25 #include "webrtc/video_receive_stream.h"
25 #include "webrtc/video_send_stream.h" 26 #include "webrtc/video_send_stream.h"
(...skipping 42 matching lines...) Expand 10 before | Expand all | Expand 10 after
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.
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 // TODO(zstein): Consider using PeerConnectionInterface::BitrateParameters
80 // instead (and move BitrateParameters to its own file in api/).
81 struct BitrateConfigMask {
82 rtc::Optional<int> min_bitrate_bps;
83 rtc::Optional<int> start_bitrate_bps;
84 rtc::Optional<int> max_bitrate_bps;
85 };
86
78 // AudioState which is possibly shared between multiple calls. 87 // AudioState which is possibly shared between multiple calls.
79 // TODO(solenberg): Change this to a shared_ptr once we can use C++11. 88 // TODO(solenberg): Change this to a shared_ptr once we can use C++11.
80 rtc::scoped_refptr<AudioState> audio_state; 89 rtc::scoped_refptr<AudioState> audio_state;
81 90
82 // Audio Processing Module to be used in this call. 91 // Audio Processing Module to be used in this call.
83 // TODO(solenberg): Change this to a shared_ptr once we can use C++11. 92 // TODO(solenberg): Change this to a shared_ptr once we can use C++11.
84 AudioProcessing* audio_processing = nullptr; 93 AudioProcessing* audio_processing = nullptr;
85 94
86 // RtcEventLog to use for this call. Required. 95 // RtcEventLog to use for this call. Required.
87 // Use webrtc::RtcEventLog::CreateNull() for a null implementation. 96 // Use webrtc::RtcEventLog::CreateNull() for a null implementation.
(...skipping 41 matching lines...) Expand 10 before | Expand all | Expand 10 after
129 138
130 // All received RTP and RTCP packets for the call should be inserted to this 139 // All received RTP and RTCP packets for the call should be inserted to this
131 // PacketReceiver. The PacketReceiver pointer is valid as long as the 140 // PacketReceiver. The PacketReceiver pointer is valid as long as the
132 // Call instance exists. 141 // Call instance exists.
133 virtual PacketReceiver* Receiver() = 0; 142 virtual PacketReceiver* Receiver() = 0;
134 143
135 // Returns the call statistics, such as estimated send and receive bandwidth, 144 // Returns the call statistics, such as estimated send and receive bandwidth,
136 // pacing delay, etc. 145 // pacing delay, etc.
137 virtual Stats GetStats() const = 0; 146 virtual Stats GetStats() const = 0;
138 147
139 // TODO(pbos): Like BitrateConfig above this is currently per-stream instead 148 // The min and start values will only be used if they are not set by
140 // of maximum for entire Call. This should be fixed along with the above. 149 // SetBitrateConfigMask. The minimum max set by the two calls will be used.
141 // Specifying a start bitrate (>0) will currently reset the current bitrate 150 // Specifying a start bitrate (>0) will reset the current bitrate estimate.
142 // estimate. This is due to how the 'x-google-start-bitrate' flag is currently 151 // This is due to how the 'x-google-start-bitrate' flag is currently
143 // implemented. 152 // implemented.
144 virtual void SetBitrateConfig( 153 virtual void SetBitrateConfig(
145 const Config::BitrateConfig& bitrate_config) = 0; 154 const Config::BitrateConfig& bitrate_config) = 0;
146 155
156 // The min and start values set here are preferred to values set by
157 // SetBitrateConfig. The minimum of the max set by the two calls will be used.
158 // Assumes 0 <= min <= start <= max holds for set parameters.
159 virtual RTCError SetBitrateConfigMask(
160 const Config::BitrateConfigMask& bitrate_mask) = 0;
161
147 // TODO(skvlad): When the unbundled case with multiple streams for the same 162 // TODO(skvlad): When the unbundled case with multiple streams for the same
148 // media type going over different networks is supported, track the state 163 // media type going over different networks is supported, track the state
149 // for each stream separately. Right now it's global per media type. 164 // for each stream separately. Right now it's global per media type.
150 virtual void SignalChannelNetworkState(MediaType media, 165 virtual void SignalChannelNetworkState(MediaType media,
151 NetworkState state) = 0; 166 NetworkState state) = 0;
152 167
153 virtual void OnTransportOverheadChanged( 168 virtual void OnTransportOverheadChanged(
154 MediaType media, 169 MediaType media,
155 int transport_overhead_per_packet) = 0; 170 int transport_overhead_per_packet) = 0;
156 171
157 virtual void OnNetworkRouteChanged( 172 virtual void OnNetworkRouteChanged(
158 const std::string& transport_name, 173 const std::string& transport_name,
159 const rtc::NetworkRoute& network_route) = 0; 174 const rtc::NetworkRoute& network_route) = 0;
160 175
161 virtual void OnSentPacket(const rtc::SentPacket& sent_packet) = 0; 176 virtual void OnSentPacket(const rtc::SentPacket& sent_packet) = 0;
162 177
163 virtual ~Call() {} 178 virtual ~Call() {}
164 }; 179 };
165 180
166 } // namespace webrtc 181 } // namespace webrtc
167 182
168 #endif // WEBRTC_CALL_CALL_H_ 183 #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