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. | |
82 // Assumes that 0 <= min <= start <= max holds for set parameters. | |
kwiberg-webrtc
2017/05/24 08:27:55
Would it make sense to document how they are combi
Zach Stein
2017/05/24 21:10:02
The combination is described in SetBirateConfig/Se
| |
83 struct BitrateConfigMask { | |
84 rtc::Optional<int> min_bitrate_bps; | |
85 rtc::Optional<int> start_bitrate_bps; | |
86 rtc::Optional<int> max_bitrate_bps; | |
87 }; | |
88 | |
78 // AudioState which is possibly shared between multiple calls. | 89 // AudioState which is possibly shared between multiple calls. |
79 // TODO(solenberg): Change this to a shared_ptr once we can use C++11. | 90 // TODO(solenberg): Change this to a shared_ptr once we can use C++11. |
80 rtc::scoped_refptr<AudioState> audio_state; | 91 rtc::scoped_refptr<AudioState> audio_state; |
81 | 92 |
82 // Audio Processing Module to be used in this call. | 93 // Audio Processing Module to be used in this call. |
83 // TODO(solenberg): Change this to a shared_ptr once we can use C++11. | 94 // TODO(solenberg): Change this to a shared_ptr once we can use C++11. |
84 AudioProcessing* audio_processing = nullptr; | 95 AudioProcessing* audio_processing = nullptr; |
85 | 96 |
86 // RtcEventLog to use for this call. Required. | 97 // RtcEventLog to use for this call. Required. |
87 // Use webrtc::RtcEventLog::CreateNull() for a null implementation. | 98 // Use webrtc::RtcEventLog::CreateNull() for a null implementation. |
(...skipping 46 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... | |
134 | 145 |
135 // All received RTP and RTCP packets for the call should be inserted to this | 146 // 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 | 147 // PacketReceiver. The PacketReceiver pointer is valid as long as the |
137 // Call instance exists. | 148 // Call instance exists. |
138 virtual PacketReceiver* Receiver() = 0; | 149 virtual PacketReceiver* Receiver() = 0; |
139 | 150 |
140 // Returns the call statistics, such as estimated send and receive bandwidth, | 151 // Returns the call statistics, such as estimated send and receive bandwidth, |
141 // pacing delay, etc. | 152 // pacing delay, etc. |
142 virtual Stats GetStats() const = 0; | 153 virtual Stats GetStats() const = 0; |
143 | 154 |
144 // TODO(pbos): Like BitrateConfig above this is currently per-stream instead | 155 // 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. | 156 // 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 | 157 // 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 | 158 // This is due to how the 'x-google-start-bitrate' flag is currently |
148 // implemented. | 159 // implemented. |
149 virtual void SetBitrateConfig( | 160 virtual void SetBitrateConfig( |
150 const Config::BitrateConfig& bitrate_config) = 0; | 161 const Config::BitrateConfig& bitrate_config) = 0; |
151 | 162 |
163 // The greater min and smaller max set by this and SetBitrateConfig will be | |
164 // used. The latest non-negative start value form either call will be used. | |
165 // Specifying a start bitrate will reset the current bitrate estimate. | |
166 // Assumes 0 <= min <= start <= max holds for set parameters. | |
167 virtual void SetBitrateConfigMask( | |
168 const Config::BitrateConfigMask& bitrate_mask) = 0; | |
169 | |
152 // TODO(skvlad): When the unbundled case with multiple streams for the same | 170 // TODO(skvlad): When the unbundled case with multiple streams for the same |
153 // media type going over different networks is supported, track the state | 171 // media type going over different networks is supported, track the state |
154 // for each stream separately. Right now it's global per media type. | 172 // for each stream separately. Right now it's global per media type. |
155 virtual void SignalChannelNetworkState(MediaType media, | 173 virtual void SignalChannelNetworkState(MediaType media, |
156 NetworkState state) = 0; | 174 NetworkState state) = 0; |
157 | 175 |
158 virtual void OnTransportOverheadChanged( | 176 virtual void OnTransportOverheadChanged( |
159 MediaType media, | 177 MediaType media, |
160 int transport_overhead_per_packet) = 0; | 178 int transport_overhead_per_packet) = 0; |
161 | 179 |
162 virtual void OnNetworkRouteChanged( | 180 virtual void OnNetworkRouteChanged( |
163 const std::string& transport_name, | 181 const std::string& transport_name, |
164 const rtc::NetworkRoute& network_route) = 0; | 182 const rtc::NetworkRoute& network_route) = 0; |
165 | 183 |
166 virtual void OnSentPacket(const rtc::SentPacket& sent_packet) = 0; | 184 virtual void OnSentPacket(const rtc::SentPacket& sent_packet) = 0; |
167 | 185 |
168 virtual ~Call() {} | 186 virtual ~Call() {} |
169 }; | 187 }; |
170 | 188 |
171 } // namespace webrtc | 189 } // namespace webrtc |
172 | 190 |
173 #endif // WEBRTC_CALL_CALL_H_ | 191 #endif // WEBRTC_CALL_CALL_H_ |
OLD | NEW |