Chromium Code Reviews
chromiumcodereview-hr@appspot.gserviceaccount.com (chromiumcodereview-hr) | Please choose your nickname with Settings | Help | Chromium Project | Gerrit Changes | Sign out
(200)

Side by Side Diff: content/renderer/media/rtc_media_constraints.cc

Issue 14893006: Add flag for enabling WebRTC AEC debug recordings. (Closed) Base URL: svn://svn.chromium.org/chrome/trunk/src
Patch Set: Hard coded string in wait for libjingle roll. Created 7 years, 7 months ago
Use n/p to move between diff chunks; N/P to move between comments. Draft comments are only viewable by you.
Jump to:
View unified diff | Download patch | Annotate | Revision Log
« no previous file with comments | « content/renderer/media/rtc_media_constraints.h ('k') | no next file » | no next file with comments »
Toggle Intra-line Diffs ('i') | Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
OLDNEW
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 "base/logging.h" 6 #include "base/logging.h"
7 7 #include "base/string_util.h"
8 #include "content/common/media/media_stream_options.h" 8 #include "content/common/media/media_stream_options.h"
9 #include "third_party/WebKit/Source/Platform/chromium/public/WebMediaConstraints .h" 9 #include "third_party/WebKit/Source/Platform/chromium/public/WebMediaConstraints .h"
10 #include "third_party/WebKit/Source/Platform/chromium/public/WebCString.h" 10 #include "third_party/WebKit/Source/Platform/chromium/public/WebCString.h"
11 #include "third_party/WebKit/Source/Platform/chromium/public/WebString.h" 11 #include "third_party/WebKit/Source/Platform/chromium/public/WebString.h"
12 12
13 namespace content { 13 namespace content {
14 namespace { 14 namespace {
15 15
16 void GetNativeMediaConstraints( 16 void GetNativeMediaConstraints(
17 const WebKit::WebVector<WebKit::WebMediaConstraint>& constraints, 17 const WebKit::WebVector<WebKit::WebMediaConstraint>& constraints,
18 webrtc::MediaConstraintsInterface::Constraints* native_constraints) { 18 webrtc::MediaConstraintsInterface::Constraints* native_constraints) {
19 DCHECK(native_constraints); 19 DCHECK(native_constraints);
20 for (size_t i = 0; i < constraints.size(); ++i) { 20 for (size_t i = 0; i < constraints.size(); ++i) {
21 webrtc::MediaConstraintsInterface::Constraint new_constraint; 21 webrtc::MediaConstraintsInterface::Constraint new_constraint;
22 new_constraint.key = constraints[i].m_name.utf8(); 22 new_constraint.key = constraints[i].m_name.utf8();
23 new_constraint.value = constraints[i].m_value.utf8(); 23 new_constraint.value = constraints[i].m_value.utf8();
24 24
25 // Ignore Chrome specific Tab capture constraints. 25 // Ignore Chrome specific Tab capture constraints.
26 if (new_constraint.key == kMediaStreamSource || 26 if (new_constraint.key == kMediaStreamSource ||
27 new_constraint.key == kMediaStreamSourceId) 27 new_constraint.key == kMediaStreamSourceId)
28 continue; 28 continue;
29
30 // Ignore internal constraints set by JS.
31 // TODO(jiayl): replace the hard coded string with
32 // webrtc::MediaConstraintsInterface::kInternalConstraintPrefix when
33 // the Libjingle change is rolled.
34 if (StartsWithASCII(new_constraint.key, "internal", true))
35 continue;
36
29 DVLOG(3) << "MediaStreamConstraints:" << new_constraint.key 37 DVLOG(3) << "MediaStreamConstraints:" << new_constraint.key
30 << " : " << new_constraint.value; 38 << " : " << new_constraint.value;
31 native_constraints->push_back(new_constraint); 39 native_constraints->push_back(new_constraint);
32 } 40 }
33 } 41 }
34 42
35 } // namespace 43 } // namespace
36 44
37 RTCMediaConstraints::RTCMediaConstraints( 45 RTCMediaConstraints::RTCMediaConstraints(
38 const WebKit::WebMediaConstraints& constraints) { 46 const WebKit::WebMediaConstraints& constraints) {
(...skipping 12 matching lines...) Expand all
51 const webrtc::MediaConstraintsInterface::Constraints& 59 const webrtc::MediaConstraintsInterface::Constraints&
52 RTCMediaConstraints::GetMandatory() const { 60 RTCMediaConstraints::GetMandatory() const {
53 return mandatory_; 61 return mandatory_;
54 } 62 }
55 63
56 const webrtc::MediaConstraintsInterface::Constraints& 64 const webrtc::MediaConstraintsInterface::Constraints&
57 RTCMediaConstraints::GetOptional() const { 65 RTCMediaConstraints::GetOptional() const {
58 return optional_; 66 return optional_;
59 } 67 }
60 68
69 void RTCMediaConstraints::AddOptional(const std::string& key,
70 const std::string& value) {
71 optional_.push_back(Constraint(key, value));
72 }
73
61 } // namespace content 74 } // namespace content
OLDNEW
« no previous file with comments | « content/renderer/media/rtc_media_constraints.h ('k') | no next file » | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698