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

Side by Side Diff: webrtc/api/mediaconstraintsinterface.h

Issue 1717583002: Non-constraint interfaces for all constrainable interfaces (Closed) Base URL: https://chromium.googlesource.com/external/webrtc.git@master
Patch Set: Review comments 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
« no previous file with comments | « webrtc/api/localaudiosource_unittest.cc ('k') | webrtc/api/mediaconstraintsinterface.cc » ('j') | no next file with comments »
Toggle Intra-line Diffs ('i') | Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
OLDNEW
1 /* 1 /*
2 * Copyright 2013 The WebRTC project authors. All Rights Reserved. 2 * Copyright 2013 The WebRTC project authors. All Rights Reserved.
3 * 3 *
4 * Use of this source code is governed by a BSD-style license 4 * Use of this source code is governed by a BSD-style license
5 * that can be found in the LICENSE file in the root of the source 5 * that can be found in the LICENSE file in the root of the source
6 * tree. An additional intellectual property rights grant can be found 6 * tree. An additional intellectual property rights grant can be found
7 * in the file PATENTS. All contributing project authors may 7 * in the file PATENTS. All contributing project authors may
8 * be found in the AUTHORS file in the root of the source tree. 8 * be found in the AUTHORS file in the root of the source tree.
9 */ 9 */
10 10
11 // This file contains the interface for MediaConstraints, corresponding to 11 // This file contains the interface for MediaConstraints, corresponding to
12 // the definition at 12 // the definition at
13 // http://www.w3.org/TR/mediacapture-streams/#mediastreamconstraints and also 13 // http://www.w3.org/TR/mediacapture-streams/#mediastreamconstraints and also
14 // used in WebRTC: http://dev.w3.org/2011/webrtc/editor/webrtc.html#constraints. 14 // used in WebRTC: http://dev.w3.org/2011/webrtc/editor/webrtc.html#constraints.
15 15
16 // This interface is being deprecated in Chrome, and may be removed
17 // from WebRTC too.
18 // https://bugs.chromium.org/p/webrtc/issues/detail?id=5617
19
16 #ifndef WEBRTC_API_MEDIACONSTRAINTSINTERFACE_H_ 20 #ifndef WEBRTC_API_MEDIACONSTRAINTSINTERFACE_H_
17 #define WEBRTC_API_MEDIACONSTRAINTSINTERFACE_H_ 21 #define WEBRTC_API_MEDIACONSTRAINTSINTERFACE_H_
18 22
19 #include <string> 23 #include <string>
20 #include <vector> 24 #include <vector>
21 25
26 #include "webrtc/base/optional.h"
27 #include "webrtc/api/peerconnectioninterface.h"
28
22 namespace webrtc { 29 namespace webrtc {
23 30
24 // MediaConstraintsInterface 31 // MediaConstraintsInterface
25 // Interface used for passing arguments about media constraints 32 // Interface used for passing arguments about media constraints
26 // to the MediaStream and PeerConnection implementation. 33 // to the MediaStream and PeerConnection implementation.
27 class MediaConstraintsInterface { 34 class MediaConstraintsInterface {
28 public: 35 public:
29 struct Constraint { 36 struct Constraint {
30 Constraint() {} 37 Constraint() {}
31 Constraint(const std::string& key, const std::string value) 38 Constraint(const std::string& key, const std::string value)
(...skipping 79 matching lines...) Expand 10 before | Expand all | Expand 10 after
111 118
112 protected: 119 protected:
113 // Dtor protected as objects shouldn't be deleted via this interface 120 // Dtor protected as objects shouldn't be deleted via this interface
114 virtual ~MediaConstraintsInterface() {} 121 virtual ~MediaConstraintsInterface() {}
115 }; 122 };
116 123
117 bool FindConstraint(const MediaConstraintsInterface* constraints, 124 bool FindConstraint(const MediaConstraintsInterface* constraints,
118 const std::string& key, bool* value, 125 const std::string& key, bool* value,
119 size_t* mandatory_constraints); 126 size_t* mandatory_constraints);
120 127
128 bool FindConstraint(const MediaConstraintsInterface* constraints,
129 const std::string& key,
130 int* value,
131 size_t* mandatory_constraints);
132
133 // Copy all relevant constraints into an RTCConfiguration object.
134 void CopyConstraintsIntoRtcConfiguration(
135 const MediaConstraintsInterface* constraints,
136 PeerConnectionInterface::RTCConfiguration* configuration);
137
121 } // namespace webrtc 138 } // namespace webrtc
122 139
123 #endif // WEBRTC_API_MEDIACONSTRAINTSINTERFACE_H_ 140 #endif // WEBRTC_API_MEDIACONSTRAINTSINTERFACE_H_
OLDNEW
« no previous file with comments | « webrtc/api/localaudiosource_unittest.cc ('k') | webrtc/api/mediaconstraintsinterface.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698