OLD | NEW |
1 /* | 1 /* |
2 * libjingle | 2 * libjingle |
3 * Copyright 2012 Google Inc. | 3 * Copyright 2012 Google Inc. |
4 * | 4 * |
5 * Redistribution and use in source and binary forms, with or without | 5 * Redistribution and use in source and binary forms, with or without |
6 * modification, are permitted provided that the following conditions are met: | 6 * modification, are permitted provided that the following conditions are met: |
7 * | 7 * |
8 * 1. Redistributions of source code must retain the above copyright notice, | 8 * 1. Redistributions of source code must retain the above copyright notice, |
9 * this list of conditions and the following disclaimer. | 9 * this list of conditions and the following disclaimer. |
10 * 2. Redistributions in binary form must reproduce the above copyright notice, | 10 * 2. Redistributions in binary form must reproduce the above copyright notice, |
(...skipping 250 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
261 best_it = it; | 261 best_it = it; |
262 } | 262 } |
263 } | 263 } |
264 return *best_it; | 264 return *best_it; |
265 } | 265 } |
266 | 266 |
267 // Set |option| to the highest-priority value of |key| in the constraints. | 267 // Set |option| to the highest-priority value of |key| in the constraints. |
268 // Return false if the key is mandatory, and the value is invalid. | 268 // Return false if the key is mandatory, and the value is invalid. |
269 bool ExtractOption(const MediaConstraintsInterface* all_constraints, | 269 bool ExtractOption(const MediaConstraintsInterface* all_constraints, |
270 const std::string& key, | 270 const std::string& key, |
271 rtc::Maybe<bool>* option) { | 271 rtc::Optional<bool>* option) { |
272 size_t mandatory = 0; | 272 size_t mandatory = 0; |
273 bool value; | 273 bool value; |
274 if (FindConstraint(all_constraints, key, &value, &mandatory)) { | 274 if (FindConstraint(all_constraints, key, &value, &mandatory)) { |
275 *option = rtc::Maybe<bool>(value); | 275 *option = rtc::Optional<bool>(value); |
276 return true; | 276 return true; |
277 } | 277 } |
278 | 278 |
279 return mandatory == 0; | 279 return mandatory == 0; |
280 } | 280 } |
281 | 281 |
282 // Search |all_constraints| for known video options. Apply all options that are | 282 // Search |all_constraints| for known video options. Apply all options that are |
283 // found with valid values, and return false if any mandatory video option was | 283 // found with valid values, and return false if any mandatory video option was |
284 // found with an invalid value. | 284 // found with an invalid value. |
285 bool ExtractVideoOptions(const MediaConstraintsInterface* all_constraints, | 285 bool ExtractVideoOptions(const MediaConstraintsInterface* all_constraints, |
(...skipping 175 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
461 } | 461 } |
462 | 462 |
463 void VideoSource::SetState(SourceState new_state) { | 463 void VideoSource::SetState(SourceState new_state) { |
464 if (VERIFY(state_ != new_state)) { | 464 if (VERIFY(state_ != new_state)) { |
465 state_ = new_state; | 465 state_ = new_state; |
466 FireOnChanged(); | 466 FireOnChanged(); |
467 } | 467 } |
468 } | 468 } |
469 | 469 |
470 } // namespace webrtc | 470 } // namespace webrtc |
OLD | NEW |