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

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

Issue 1729683002: Remove old-style constraints from Chrome internals (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: Complete the interface change Created 4 years, 9 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
OLDNEW
(Empty)
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
3 // found in the LICENSE file.
4
5 #ifndef CONTENT_RENDERER_MEDIA_RTC_MEDIA_CONSTRAINTS_H_
6 #define CONTENT_RENDERER_MEDIA_RTC_MEDIA_CONSTRAINTS_H_
7
8 #include "base/compiler_specific.h"
9 #include "content/common/content_export.h"
10 #include "third_party/webrtc/api/mediaconstraintsinterface.h"
11
12 namespace blink {
13 class WebMediaConstraints;
14 }
15
16 namespace content {
17
18 // RTCMediaConstraints acts as a glue layer between WebKits MediaConstraints and
19 // libjingle webrtc::MediaConstraintsInterface.
20 // Constraints are used by PeerConnection and getUserMedia API calls.
21 class CONTENT_EXPORT RTCMediaConstraints
22 : public NON_EXPORTED_BASE(webrtc::MediaConstraintsInterface) {
23 public:
24 RTCMediaConstraints();
25 explicit RTCMediaConstraints(
26 const blink::WebMediaConstraints& constraints);
27 ~RTCMediaConstraints() override;
28 const Constraints& GetMandatory() const override;
29 const Constraints& GetOptional() const override;
30 // Adds a mandatory constraint, optionally overriding an existing one.
31 // If the constraint is already set and |override_if_exists| is false,
32 // the function will return false, otherwise true.
33 bool AddMandatory(const std::string& key, const std::string& value,
34 bool override_if_exists);
35 // As above, but against the optional constraints.
36 bool AddOptional(const std::string& key, const std::string& value,
37 bool override_if_exists);
38
39 protected:
40 bool AddConstraint(Constraints* constraints,
41 const std::string& key,
42 const std::string& value,
43 bool override_if_exists);
44 Constraints mandatory_;
45 Constraints optional_;
46 };
47
48 } // namespace content
49
50
51 #endif // CONTENT_RENDERER_MEDIA_RTC_MEDIA_CONSTRAINTS_H_
OLDNEW
« no previous file with comments | « content/renderer/media/peer_connection_tracker_unittest.cc ('k') | content/renderer/media/rtc_media_constraints.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698