OLD | NEW |
1 // Copyright (c) 2012 The Chromium Authors. All rights reserved. | 1 // Copyright (c) 2012 The Chromium Authors. All rights reserved. |
2 // Use of this source code is governed by a BSD-style license that can be | 2 // Use of this source code is governed by a BSD-style license that can be |
3 // found in the LICENSE file. | 3 // found in the LICENSE file. |
4 | 4 |
5 #include "content/common/media/media_stream_options.h" | 5 #include "content/common/media/media_stream_options.h" |
6 | 6 |
7 #include "base/logging.h" | 7 #include "base/logging.h" |
8 | 8 |
9 namespace content { | 9 namespace content { |
10 | 10 |
(...skipping 24 matching lines...) Expand all Loading... |
35 } | 35 } |
36 return false; | 36 return false; |
37 } | 37 } |
38 | 38 |
39 bool GetFirstConstraintByName(const StreamOptions::Constraints& mandatory, | 39 bool GetFirstConstraintByName(const StreamOptions::Constraints& mandatory, |
40 const StreamOptions::Constraints& optional, | 40 const StreamOptions::Constraints& optional, |
41 const std::string& name, | 41 const std::string& name, |
42 std::string* value, | 42 std::string* value, |
43 bool* is_mandatory) { | 43 bool* is_mandatory) { |
44 if (GetFirstConstraintByName(mandatory, name, value)) { | 44 if (GetFirstConstraintByName(mandatory, name, value)) { |
45 if (is_mandatory) | |
46 *is_mandatory = true; | |
47 return true; | |
48 } | |
49 if (is_mandatory) | 45 if (is_mandatory) |
50 *is_mandatory = false; | 46 *is_mandatory = true; |
51 return GetFirstConstraintByName(optional, name, value); | 47 return true; |
| 48 } |
| 49 if (is_mandatory) |
| 50 *is_mandatory = false; |
| 51 return GetFirstConstraintByName(optional, name, value); |
52 } | 52 } |
53 | 53 |
54 } // namespace | 54 } // namespace |
55 | 55 |
56 StreamOptions::StreamOptions() | 56 StreamOptions::StreamOptions() |
57 : audio_requested(false), | 57 : audio_requested(false), |
58 video_requested(false) {} | 58 video_requested(false) {} |
59 | 59 |
60 StreamOptions::StreamOptions(bool request_audio, bool request_video) | 60 StreamOptions::StreamOptions(bool request_audio, bool request_video) |
61 : audio_requested(request_audio), video_requested(request_video) { | 61 : audio_requested(request_audio), video_requested(request_video) { |
(...skipping 59 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
121 } | 121 } |
122 | 122 |
123 // static | 123 // static |
124 bool StreamDeviceInfo::IsEqual(const StreamDeviceInfo& first, | 124 bool StreamDeviceInfo::IsEqual(const StreamDeviceInfo& first, |
125 const StreamDeviceInfo& second) { | 125 const StreamDeviceInfo& second) { |
126 return first.device.IsEqual(second.device) && | 126 return first.device.IsEqual(second.device) && |
127 first.session_id == second.session_id; | 127 first.session_id == second.session_id; |
128 } | 128 } |
129 | 129 |
130 } // namespace content | 130 } // namespace content |
OLD | NEW |