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_ |
(...skipping 57 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
68 static const int kDefaultStartBitrateBps; | 68 static const int kDefaultStartBitrateBps; |
69 | 69 |
70 // Bitrate config used until valid bitrate estimates are calculated. Also | 70 // Bitrate config used until valid bitrate estimates are calculated. Also |
71 // used to cap total bitrate used. | 71 // used to cap total bitrate used. |
72 struct BitrateConfig { | 72 struct BitrateConfig { |
73 int min_bitrate_bps = 0; | 73 int min_bitrate_bps = 0; |
74 int start_bitrate_bps = kDefaultStartBitrateBps; | 74 int start_bitrate_bps = kDefaultStartBitrateBps; |
75 int max_bitrate_bps = -1; | 75 int max_bitrate_bps = -1; |
76 } bitrate_config; | 76 } bitrate_config; |
77 | 77 |
| 78 // TODO(zstein): Consider using PeerConnectionInterface::BitrateParameters |
| 79 // instead (and move BitrateParameters to its own file in api/). |
| 80 struct BitrateConfigMask { |
| 81 rtc::Optional<int> min_bitrate_bps; |
| 82 rtc::Optional<int> start_bitrate_bps; |
| 83 rtc::Optional<int> max_bitrate_bps; |
| 84 }; |
| 85 |
78 // AudioState which is possibly shared between multiple calls. | 86 // AudioState which is possibly shared between multiple calls. |
79 // TODO(solenberg): Change this to a shared_ptr once we can use C++11. | 87 // TODO(solenberg): Change this to a shared_ptr once we can use C++11. |
80 rtc::scoped_refptr<AudioState> audio_state; | 88 rtc::scoped_refptr<AudioState> audio_state; |
81 | 89 |
82 // Audio Processing Module to be used in this call. | 90 // Audio Processing Module to be used in this call. |
83 // 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. |
84 AudioProcessing* audio_processing = nullptr; | 92 AudioProcessing* audio_processing = nullptr; |
85 | 93 |
86 // RtcEventLog to use for this call. Required. | 94 // RtcEventLog to use for this call. Required. |
87 // Use webrtc::RtcEventLog::CreateNull() for a null implementation. | 95 // Use webrtc::RtcEventLog::CreateNull() for a null implementation. |
(...skipping 41 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
129 | 137 |
130 // All received RTP and RTCP packets for the call should be inserted to this | 138 // 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 | 139 // PacketReceiver. The PacketReceiver pointer is valid as long as the |
132 // Call instance exists. | 140 // Call instance exists. |
133 virtual PacketReceiver* Receiver() = 0; | 141 virtual PacketReceiver* Receiver() = 0; |
134 | 142 |
135 // Returns the call statistics, such as estimated send and receive bandwidth, | 143 // Returns the call statistics, such as estimated send and receive bandwidth, |
136 // pacing delay, etc. | 144 // pacing delay, etc. |
137 virtual Stats GetStats() const = 0; | 145 virtual Stats GetStats() const = 0; |
138 | 146 |
139 // TODO(pbos): Like BitrateConfig above this is currently per-stream instead | 147 // 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. | 148 // SetBitrateConfigMask. The minimum max set by the two calls will be used. |
141 // Specifying a start bitrate (>0) will currently reset the current bitrate | 149 // 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 | 150 // This is due to how the 'x-google-start-bitrate' flag is currently |
143 // implemented. | 151 // implemented. |
144 virtual void SetBitrateConfig( | 152 virtual void SetBitrateConfig( |
145 const Config::BitrateConfig& bitrate_config) = 0; | 153 const Config::BitrateConfig& bitrate_config) = 0; |
146 | 154 |
| 155 // The min and start values set here are preferred to values set by |
| 156 // SetBitrateConfig. The minimum of the max set by the two calls will be used. |
| 157 virtual void SetBitrateConfigMask( |
| 158 const Config::BitrateConfigMask& bitrate_mask) = 0; |
| 159 |
147 // TODO(skvlad): When the unbundled case with multiple streams for the same | 160 // TODO(skvlad): When the unbundled case with multiple streams for the same |
148 // media type going over different networks is supported, track the state | 161 // media type going over different networks is supported, track the state |
149 // for each stream separately. Right now it's global per media type. | 162 // for each stream separately. Right now it's global per media type. |
150 virtual void SignalChannelNetworkState(MediaType media, | 163 virtual void SignalChannelNetworkState(MediaType media, |
151 NetworkState state) = 0; | 164 NetworkState state) = 0; |
152 | 165 |
153 virtual void OnTransportOverheadChanged( | 166 virtual void OnTransportOverheadChanged( |
154 MediaType media, | 167 MediaType media, |
155 int transport_overhead_per_packet) = 0; | 168 int transport_overhead_per_packet) = 0; |
156 | 169 |
157 virtual void OnNetworkRouteChanged( | 170 virtual void OnNetworkRouteChanged( |
158 const std::string& transport_name, | 171 const std::string& transport_name, |
159 const rtc::NetworkRoute& network_route) = 0; | 172 const rtc::NetworkRoute& network_route) = 0; |
160 | 173 |
161 virtual void OnSentPacket(const rtc::SentPacket& sent_packet) = 0; | 174 virtual void OnSentPacket(const rtc::SentPacket& sent_packet) = 0; |
162 | 175 |
163 virtual ~Call() {} | 176 virtual ~Call() {} |
164 }; | 177 }; |
165 | 178 |
166 } // namespace webrtc | 179 } // namespace webrtc |
167 | 180 |
168 #endif // WEBRTC_CALL_CALL_H_ | 181 #endif // WEBRTC_CALL_CALL_H_ |
OLD | NEW |