OLD | NEW |
---|---|
1 /* | 1 /* |
2 * Copyright 2015 The WebRTC project authors. All Rights Reserved. | 2 * Copyright 2015 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 | 10 |
(...skipping 66 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... | |
77 | 77 |
78 struct RtcpFeedback { | 78 struct RtcpFeedback { |
79 RtcpFeedbackType type = RtcpFeedbackType::ACK; | 79 RtcpFeedbackType type = RtcpFeedbackType::ACK; |
80 | 80 |
81 // Equivalent to ORTC "parameter" field with slight differences: | 81 // Equivalent to ORTC "parameter" field with slight differences: |
82 // 1. It's an enum instead of a string. | 82 // 1. It's an enum instead of a string. |
83 // 2. Generic NACK feedback is represented by a GENERIC_NACK message type, | 83 // 2. Generic NACK feedback is represented by a GENERIC_NACK message type, |
84 // rather than an unset "parameter" value. | 84 // rather than an unset "parameter" value. |
85 rtc::Optional<RtcpFeedbackMessageType> message_type; | 85 rtc::Optional<RtcpFeedbackMessageType> message_type; |
86 | 86 |
87 // Constructors for convenience. | |
88 RtcpFeedback() {} | |
89 explicit RtcpFeedback(RtcpFeedbackType type) : type(type) {} | |
90 RtcpFeedback(RtcpFeedbackType type, RtcpFeedbackMessageType message_type) | |
91 : type(type), message_type(message_type) {} | |
92 | |
87 bool operator==(const RtcpFeedback& o) const { | 93 bool operator==(const RtcpFeedback& o) const { |
88 return type == o.type && message_type == o.message_type; | 94 return type == o.type && message_type == o.message_type; |
89 } | 95 } |
90 bool operator!=(const RtcpFeedback& o) const { return !(*this == o); } | 96 bool operator!=(const RtcpFeedback& o) const { return !(*this == o); } |
91 }; | 97 }; |
92 | 98 |
93 // RtpCodecCapability is to RtpCodecParameters as RtpCapabilities is to | 99 // RtpCodecCapability is to RtpCodecParameters as RtpCapabilities is to |
94 // RtpParameters. This represents the static capabilities of an endpoint's | 100 // RtpParameters. This represents the static capabilities of an endpoint's |
95 // implementation of a codec. | 101 // implementation of a codec. |
96 struct RtpCodecCapability { | 102 struct RtpCodecCapability { |
(...skipping 80 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... | |
177 // URI of this extension, as defined in RFC5285. | 183 // URI of this extension, as defined in RFC5285. |
178 std::string uri; | 184 std::string uri; |
179 | 185 |
180 // Preferred value of ID that goes in the packet. | 186 // Preferred value of ID that goes in the packet. |
181 rtc::Optional<int> preferred_id; | 187 rtc::Optional<int> preferred_id; |
182 | 188 |
183 // If true, it's preferred that the value in the header is encrypted. | 189 // If true, it's preferred that the value in the header is encrypted. |
184 // TODO(deadbeef): Not implemented. | 190 // TODO(deadbeef): Not implemented. |
185 bool preferred_encrypt = false; | 191 bool preferred_encrypt = false; |
186 | 192 |
193 // Constructors for convenience. | |
194 RtpHeaderExtensionCapability() {} | |
195 explicit RtpHeaderExtensionCapability(const std::string& uri) : uri(uri) {} | |
196 RtpHeaderExtensionCapability(const std::string& uri, int preferred_id) | |
197 : uri(uri), preferred_id(preferred_id) {} | |
198 | |
187 bool operator==(const RtpHeaderExtensionCapability& o) const { | 199 bool operator==(const RtpHeaderExtensionCapability& o) const { |
188 return uri == o.uri && preferred_id == o.preferred_id && | 200 return uri == o.uri && preferred_id == o.preferred_id && |
189 preferred_encrypt == o.preferred_encrypt; | 201 preferred_encrypt == o.preferred_encrypt; |
190 } | 202 } |
191 bool operator!=(const RtpHeaderExtensionCapability& o) const { | 203 bool operator!=(const RtpHeaderExtensionCapability& o) const { |
192 return !(*this == o); | 204 return !(*this == o); |
193 } | 205 } |
194 }; | 206 }; |
195 | 207 |
196 // Used in RtpParameters; represents a specific configuration of a header | 208 // Used in RtpParameters; represents a specific configuration of a header |
(...skipping 12 matching lines...) Expand all Loading... | |
209 bool operator==(const RtpHeaderExtensionParameters& o) const { | 221 bool operator==(const RtpHeaderExtensionParameters& o) const { |
210 return uri == o.uri && id == o.id && encrypt == o.encrypt; | 222 return uri == o.uri && id == o.id && encrypt == o.encrypt; |
211 } | 223 } |
212 bool operator!=(const RtpHeaderExtensionParameters& o) const { | 224 bool operator!=(const RtpHeaderExtensionParameters& o) const { |
213 return !(*this == o); | 225 return !(*this == o); |
214 } | 226 } |
215 }; | 227 }; |
216 | 228 |
217 struct RtpFecParameters { | 229 struct RtpFecParameters { |
218 // If unset, a value is chosen by the implementation. | 230 // If unset, a value is chosen by the implementation. |
231 // Works just like RtpEncodingParameters.ssrc. | |
219 rtc::Optional<uint32_t> ssrc; | 232 rtc::Optional<uint32_t> ssrc; |
220 | 233 |
221 FecMechanism mechanism = FecMechanism::RED; | 234 FecMechanism mechanism = FecMechanism::RED; |
222 | 235 |
223 bool operator==(const RtpFecParameters& o) const { | 236 bool operator==(const RtpFecParameters& o) const { |
224 return ssrc == o.ssrc && mechanism == o.mechanism; | 237 return ssrc == o.ssrc && mechanism == o.mechanism; |
225 } | 238 } |
226 bool operator!=(const RtpFecParameters& o) const { return !(*this == o); } | 239 bool operator!=(const RtpFecParameters& o) const { return !(*this == o); } |
227 }; | 240 }; |
228 | 241 |
229 struct RtpRtxParameters { | 242 struct RtpRtxParameters { |
230 // If unset, a value is chosen by the implementation. | 243 // If unset, a value is chosen by the implementation. |
244 // Works just like RtpEncodingParameters.ssrc. | |
231 rtc::Optional<uint32_t> ssrc; | 245 rtc::Optional<uint32_t> ssrc; |
232 | 246 |
233 bool operator==(const RtpRtxParameters& o) const { return ssrc == o.ssrc; } | 247 bool operator==(const RtpRtxParameters& o) const { return ssrc == o.ssrc; } |
234 bool operator!=(const RtpRtxParameters& o) const { return !(*this == o); } | 248 bool operator!=(const RtpRtxParameters& o) const { return !(*this == o); } |
235 }; | 249 }; |
236 | 250 |
237 struct RtpEncodingParameters { | 251 struct RtpEncodingParameters { |
238 // If unset, a value is chosen by the implementation. | 252 // If unset, a value is chosen by the implementation. |
253 // Note that the chosen value is NOT returned by GetParameters, because it | |
254 // may change due to an SSRC conflict, in which case the conflict is handled | |
255 // internally without any event. | |
pthatcher1
2017/02/08 01:33:49
I don't see why we couldn't return it in GetParame
Taylor Brandstetter
2017/02/10 00:19:45
Yeah. You wouldn't want to do "Set" with an option
| |
239 rtc::Optional<uint32_t> ssrc; | 256 rtc::Optional<uint32_t> ssrc; |
240 | 257 |
241 // Can be used to reference a codec in the |codecs| member of the | 258 // Can be used to reference a codec in the |codecs| member of the |
242 // RtpParameters that contains this RtpEncodingParameters. If unset, the | 259 // RtpParameters that contains this RtpEncodingParameters. If unset, the |
243 // implementation will choose the first possible codec. | 260 // implementation will choose the first possible codec. |
244 // TODO(deadbeef): Not implemented. | 261 // TODO(deadbeef): Not implemented. |
245 rtc::Optional<int> codec_payload_type; | 262 rtc::Optional<int> codec_payload_type; |
246 | 263 |
247 // Specifies the FEC mechanism, if set. | 264 // Specifies the FEC mechanism, if set. |
248 // TODO(deadbeef): Not implemented. | 265 // TODO(deadbeef): Not implemented. |
249 rtc::Optional<RtpFecParameters> fec; | 266 rtc::Optional<RtpFecParameters> fec; |
250 | 267 |
251 // Specifies the RTX parameters, if set. | 268 // Specifies the RTX parameters, if set. |
252 // TODO(deadbeef): Not implemented. | 269 // TODO(deadbeef): Not implemented with PeerConnection senders/receivers. |
253 rtc::Optional<RtpRtxParameters> rtx; | 270 rtc::Optional<RtpRtxParameters> rtx; |
254 | 271 |
255 // Only used for audio. If set, determines whether or not discontinuous | 272 // Only used for audio. If set, determines whether or not discontinuous |
256 // transmission will be used, if an available codec supports it. If not | 273 // transmission will be used, if an available codec supports it. If not |
257 // set, the implementation default setting will be used. | 274 // set, the implementation default setting will be used. |
275 // TODO(deadbeef): Not implemented. | |
258 rtc::Optional<DtxStatus> dtx; | 276 rtc::Optional<DtxStatus> dtx; |
259 | 277 |
260 // The relative priority of this encoding. | 278 // The relative priority of this encoding. |
261 // TODO(deadbeef): Not implemented. | 279 // TODO(deadbeef): Not implemented. |
262 rtc::Optional<PriorityType> priority; | 280 rtc::Optional<PriorityType> priority; |
263 | 281 |
264 // If set, this represents the Transport Independent Application Specific | 282 // If set, this represents the Transport Independent Application Specific |
265 // maximum bandwidth defined in RFC3890. If unset, there is no maximum | 283 // maximum bandwidth defined in RFC3890. If unset, there is no maximum |
266 // bitrate. | 284 // bitrate. |
267 // Just called "maxBitrate" in ORTC spec. | 285 // Just called "maxBitrate" in ORTC spec. |
(...skipping 122 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... | |
390 // TODO(deadbeef): Not implemented. | 408 // TODO(deadbeef): Not implemented. |
391 std::string transaction_id; | 409 std::string transaction_id; |
392 | 410 |
393 // Value to use for MID RTP header extension. | 411 // Value to use for MID RTP header extension. |
394 // Called "muxId" in ORTC. | 412 // Called "muxId" in ORTC. |
395 // TODO(deadbeef): Not implemented. | 413 // TODO(deadbeef): Not implemented. |
396 std::string mid; | 414 std::string mid; |
397 | 415 |
398 std::vector<RtpCodecParameters> codecs; | 416 std::vector<RtpCodecParameters> codecs; |
399 | 417 |
400 // TODO(deadbeef): Not implemented. | 418 // TODO(deadbeef): Not implemented with PeerConnection senders/receivers. |
401 std::vector<RtpHeaderExtensionParameters> header_extensions; | 419 std::vector<RtpHeaderExtensionParameters> header_extensions; |
402 | 420 |
403 std::vector<RtpEncodingParameters> encodings; | 421 std::vector<RtpEncodingParameters> encodings; |
404 | 422 |
405 // TODO(deadbeef): Not implemented. | 423 // TODO(deadbeef): Not implemented. |
406 DegradationPreference degradation_preference = | 424 DegradationPreference degradation_preference = |
407 DegradationPreference::BALANCED; | 425 DegradationPreference::BALANCED; |
408 | 426 |
409 bool operator==(const RtpParameters& o) const { | 427 bool operator==(const RtpParameters& o) const { |
410 return mid == o.mid && codecs == o.codecs && | 428 return mid == o.mid && codecs == o.codecs && |
411 header_extensions == o.header_extensions && | 429 header_extensions == o.header_extensions && |
412 encodings == o.encodings && | 430 encodings == o.encodings && |
413 degradation_preference == o.degradation_preference; | 431 degradation_preference == o.degradation_preference; |
414 } | 432 } |
415 bool operator!=(const RtpParameters& o) const { return !(*this == o); } | 433 bool operator!=(const RtpParameters& o) const { return !(*this == o); } |
416 }; | 434 }; |
417 | 435 |
418 } // namespace webrtc | 436 } // namespace webrtc |
419 | 437 |
420 #endif // WEBRTC_API_RTPPARAMETERS_H_ | 438 #endif // WEBRTC_API_RTPPARAMETERS_H_ |
OLD | NEW |