OLD | NEW |
1 /* | 1 /* |
2 * Copyright 2004 The WebRTC project authors. All Rights Reserved. | 2 * Copyright 2004 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 347 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
358 } | 358 } |
359 | 359 |
360 private: | 360 private: |
361 // Returns the first unused id in reverse order. | 361 // Returns the first unused id in reverse order. |
362 // This hopefully reduce the risk of more collisions. We want to change the | 362 // This hopefully reduce the risk of more collisions. We want to change the |
363 // default ids as little as possible. | 363 // default ids as little as possible. |
364 int FindUnusedId() { | 364 int FindUnusedId() { |
365 while (IsIdUsed(next_id_) && next_id_ >= min_allowed_id_) { | 365 while (IsIdUsed(next_id_) && next_id_ >= min_allowed_id_) { |
366 --next_id_; | 366 --next_id_; |
367 } | 367 } |
368 ASSERT(next_id_ >= min_allowed_id_); | 368 RTC_DCHECK(next_id_ >= min_allowed_id_); |
369 return next_id_; | 369 return next_id_; |
370 } | 370 } |
371 | 371 |
372 bool IsIdUsed(int new_id) { | 372 bool IsIdUsed(int new_id) { |
373 return id_set_.find(new_id) != id_set_.end(); | 373 return id_set_.find(new_id) != id_set_.end(); |
374 } | 374 } |
375 | 375 |
376 void SetIdUsed(int new_id) { | 376 void SetIdUsed(int new_id) { |
377 id_set_.insert(new_id); | 377 id_set_.insert(new_id); |
378 } | 378 } |
(...skipping 1084 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
1463 if (!AddAudioContentForAnswer(offer, options, current_description, | 1463 if (!AddAudioContentForAnswer(offer, options, current_description, |
1464 ¤t_streams, answer.get())) { | 1464 ¤t_streams, answer.get())) { |
1465 return NULL; | 1465 return NULL; |
1466 } | 1466 } |
1467 } else if (IsMediaContentOfType(&*it, MEDIA_TYPE_VIDEO)) { | 1467 } else if (IsMediaContentOfType(&*it, MEDIA_TYPE_VIDEO)) { |
1468 if (!AddVideoContentForAnswer(offer, options, current_description, | 1468 if (!AddVideoContentForAnswer(offer, options, current_description, |
1469 ¤t_streams, answer.get())) { | 1469 ¤t_streams, answer.get())) { |
1470 return NULL; | 1470 return NULL; |
1471 } | 1471 } |
1472 } else { | 1472 } else { |
1473 ASSERT(IsMediaContentOfType(&*it, MEDIA_TYPE_DATA)); | 1473 RTC_DCHECK(IsMediaContentOfType(&*it, MEDIA_TYPE_DATA)); |
1474 if (!AddDataContentForAnswer(offer, options, current_description, | 1474 if (!AddDataContentForAnswer(offer, options, current_description, |
1475 ¤t_streams, answer.get())) { | 1475 ¤t_streams, answer.get())) { |
1476 return NULL; | 1476 return NULL; |
1477 } | 1477 } |
1478 } | 1478 } |
1479 } | 1479 } |
1480 } | 1480 } |
1481 | 1481 |
1482 // If the offer supports BUNDLE, and we want to use it too, create a BUNDLE | 1482 // If the offer supports BUNDLE, and we want to use it too, create a BUNDLE |
1483 // group in the answer with the appropriate content names. | 1483 // group in the answer with the appropriate content names. |
(...skipping 703 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
2187 GetFirstMediaContentDescription(sdesc, MEDIA_TYPE_VIDEO)); | 2187 GetFirstMediaContentDescription(sdesc, MEDIA_TYPE_VIDEO)); |
2188 } | 2188 } |
2189 | 2189 |
2190 DataContentDescription* GetFirstDataContentDescription( | 2190 DataContentDescription* GetFirstDataContentDescription( |
2191 SessionDescription* sdesc) { | 2191 SessionDescription* sdesc) { |
2192 return static_cast<DataContentDescription*>( | 2192 return static_cast<DataContentDescription*>( |
2193 GetFirstMediaContentDescription(sdesc, MEDIA_TYPE_DATA)); | 2193 GetFirstMediaContentDescription(sdesc, MEDIA_TYPE_DATA)); |
2194 } | 2194 } |
2195 | 2195 |
2196 } // namespace cricket | 2196 } // namespace cricket |
OLD | NEW |