Index: content/renderer/media/media_stream_constraints_util.h |
diff --git a/content/renderer/media/media_stream_constraints_util.h b/content/renderer/media/media_stream_constraints_util.h |
new file mode 100644 |
index 0000000000000000000000000000000000000000..60543b1318d144e09c12611bc6b44086e0d8a4e5 |
--- /dev/null |
+++ b/content/renderer/media/media_stream_constraints_util.h |
@@ -0,0 +1,64 @@ |
+// Copyright 2014 The Chromium Authors. All rights reserved. |
+// Use of this source code is governed by a BSD-style license that can be |
+// found in the LICENSE file. |
+ |
+#ifndef CONTENT_RENDERER_MEDIA_MEDIA_STREAM_CONSTRAINTS_UTIL_H_ |
+#define CONTENT_RENDERER_MEDIA_MEDIA_STREAM_CONSTRAINTS_UTIL_H_ |
+ |
+#include <string> |
+ |
+namespace blink { |
+class WebMediaConstraints; |
+class WebString; |
+} |
+ |
+namespace content { |
+ |
+// Method to get boolean value of constraint with |key| from constraints. |
+// Returns true if the constraint is specified in either mandatory or optional |
+// constraints. |
+bool GetConstraintValue(const blink::WebMediaConstraints& constraints, |
+ const std::string& key, |
+ bool* value); |
+ |
+// Method to get int value of constraint with |key| from constraints. |
+// Returns true if the constraint is specified in either mandatory or Optional |
+// constraints. |
+bool GetConstraintValue(const blink::WebMediaConstraints& constraints, |
+ const std::string& key, |
+ int* value); |
+ |
+// Method to get std::string value of constraint with |key| from constraints. |
+// Returns true if the constraint is specified in either mandatory or Optional |
+// constraints. |
+bool GetConstraintValue(const blink::WebMediaConstraints& constraints, |
+ const std::string& key, |
+ std::string* value); |
+ |
+// Method to get boolean value of constraint with |key| from the |
+// mandatory constraints. |
+bool GetMandatoryConstraintValue(const blink::WebMediaConstraints& constraints, |
+ const std::string& name, |
+ bool* value); |
+ |
+// Method to get int value of constraint with |key| from the |
+// mandatory constraints. |
+bool GetMandatoryConstraintValue(const blink::WebMediaConstraints& constraints, |
+ const std::string& name, |
+ int* value); |
+ |
+// Method to get bool value of constraint with |key| from the |
+// optional constraints. |
+bool GetOptionalConstraintValue(const blink::WebMediaConstraints& constraints, |
+ const std::string& name, |
+ bool* value); |
+ |
+// Method to get int value of constraint with |key| from the |
+// optional constraints. |
+bool GetOptionalConstraintValue(const blink::WebMediaConstraints& constraints, |
+ const std::string& name, |
+ int* value); |
+ |
+} // namespace content |
+ |
+#endif // CONTENT_RENDERER_MEDIA_MEDIA_STREAM_CONSTRAINTS_UTIL_H_ |