OLD | NEW |
---|---|
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 Loading... | |
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 Loading... | |
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. |
holmer
2017/05/31 07:46:34
I think it would be good to specify what start bit
Zach Stein
2017/06/01 03:37:49
start_bitrate == 0 is disallowed by DCHECK, but it
Taylor Brandstetter
2017/06/01 16:24:43
The value of a comment here is that it tells you w
| |
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. |
149 virtual void SetBitrateConfig( | 161 virtual void SetBitrateConfig( |
150 const Config::BitrateConfig& bitrate_config) = 0; | 162 const Config::BitrateConfig& bitrate_config) = 0; |
151 | 163 |
164 // The greater min and smaller max set by this and SetBitrateConfig will be | |
165 // used. The latest non-negative start value form either call will be used. | |
166 // Specifying a start bitrate will reset the current bitrate estimate. | |
167 // Assumes 0 <= min <= start <= max holds for set parameters. | |
168 virtual void SetBitrateConfigMask( | |
169 const Config::BitrateConfigMask& bitrate_mask) = 0; | |
170 | |
152 // TODO(skvlad): When the unbundled case with multiple streams for the same | 171 // TODO(skvlad): When the unbundled case with multiple streams for the same |
153 // media type going over different networks is supported, track the state | 172 // media type going over different networks is supported, track the state |
154 // for each stream separately. Right now it's global per media type. | 173 // for each stream separately. Right now it's global per media type. |
155 virtual void SignalChannelNetworkState(MediaType media, | 174 virtual void SignalChannelNetworkState(MediaType media, |
156 NetworkState state) = 0; | 175 NetworkState state) = 0; |
157 | 176 |
158 virtual void OnTransportOverheadChanged( | 177 virtual void OnTransportOverheadChanged( |
159 MediaType media, | 178 MediaType media, |
160 int transport_overhead_per_packet) = 0; | 179 int transport_overhead_per_packet) = 0; |
161 | 180 |
162 virtual void OnNetworkRouteChanged( | 181 virtual void OnNetworkRouteChanged( |
163 const std::string& transport_name, | 182 const std::string& transport_name, |
164 const rtc::NetworkRoute& network_route) = 0; | 183 const rtc::NetworkRoute& network_route) = 0; |
165 | 184 |
166 virtual void OnSentPacket(const rtc::SentPacket& sent_packet) = 0; | 185 virtual void OnSentPacket(const rtc::SentPacket& sent_packet) = 0; |
167 | 186 |
168 virtual ~Call() {} | 187 virtual ~Call() {} |
169 }; | 188 }; |
170 | 189 |
171 } // namespace webrtc | 190 } // namespace webrtc |
172 | 191 |
173 #endif // WEBRTC_CALL_CALL_H_ | 192 #endif // WEBRTC_CALL_CALL_H_ |
OLD | NEW |