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 #include "content/renderer/media/rtc_media_constraints.h" | 4 #include "content/renderer/media/rtc_media_constraints.h" |
5 | 5 |
6 #include <string> | 6 #include <string> |
7 | 7 |
8 #include "base/logging.h" | 8 #include "base/logging.h" |
9 #include "base/strings/string_util.h" | 9 #include "base/strings/string_util.h" |
10 #include "content/common/media/media_stream_options.h" | 10 #include "content/common/media/media_stream_options.h" |
(...skipping 15 matching lines...) Expand all Loading... |
26 | 26 |
27 // Ignore Chrome specific Tab capture constraints. | 27 // Ignore Chrome specific Tab capture constraints. |
28 if (new_constraint.key == kMediaStreamSource || | 28 if (new_constraint.key == kMediaStreamSource || |
29 new_constraint.key == kMediaStreamSourceId) | 29 new_constraint.key == kMediaStreamSourceId) |
30 continue; | 30 continue; |
31 | 31 |
32 // Ignore sourceId constraint since that has nothing to do with webrtc. | 32 // Ignore sourceId constraint since that has nothing to do with webrtc. |
33 if (new_constraint.key == kMediaStreamSourceInfoId) | 33 if (new_constraint.key == kMediaStreamSourceInfoId) |
34 continue; | 34 continue; |
35 | 35 |
36 // Ignore internal constraints set by JS. | |
37 if (StartsWithASCII( | |
38 new_constraint.key, | |
39 webrtc::MediaConstraintsInterface::kInternalConstraintPrefix, | |
40 true)) { | |
41 continue; | |
42 } | |
43 | |
44 DVLOG(3) << "MediaStreamConstraints:" << new_constraint.key | 36 DVLOG(3) << "MediaStreamConstraints:" << new_constraint.key |
45 << " : " << new_constraint.value; | 37 << " : " << new_constraint.value; |
46 native_constraints->push_back(new_constraint); | 38 native_constraints->push_back(new_constraint); |
47 } | 39 } |
48 } | 40 } |
49 | 41 |
50 } // namespace | 42 } // namespace |
51 | 43 |
52 RTCMediaConstraints::RTCMediaConstraints() {} | 44 RTCMediaConstraints::RTCMediaConstraints() {} |
53 | 45 |
(...skipping 37 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
91 iter->value = value; | 83 iter->value = value; |
92 return override_if_exists; | 84 return override_if_exists; |
93 } | 85 } |
94 } | 86 } |
95 // The key wasn't found, add it. | 87 // The key wasn't found, add it. |
96 mandatory_.push_back(Constraint(key, value)); | 88 mandatory_.push_back(Constraint(key, value)); |
97 return true; | 89 return true; |
98 } | 90 } |
99 | 91 |
100 } // namespace content | 92 } // namespace content |
OLD | NEW |