OLD | NEW |
1 // Copyright 2014 The Chromium Authors. All rights reserved. | 1 // Copyright 2014 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 | 4 |
5 #ifndef CONTENT_RENDERER_MEDIA_MEDIA_STREAM_CONSTRAINTS_UTIL_H_ | 5 #ifndef CONTENT_RENDERER_MEDIA_MEDIA_STREAM_CONSTRAINTS_UTIL_H_ |
6 #define CONTENT_RENDERER_MEDIA_MEDIA_STREAM_CONSTRAINTS_UTIL_H_ | 6 #define CONTENT_RENDERER_MEDIA_MEDIA_STREAM_CONSTRAINTS_UTIL_H_ |
7 | 7 |
8 #include <string> | 8 #include <string> |
9 | 9 |
10 #include "content/common/content_export.h" | 10 #include "content/common/content_export.h" |
11 | 11 |
12 namespace blink { | 12 namespace blink { |
13 class WebMediaConstraints; | 13 class WebMediaConstraints; |
14 class WebString; | 14 class WebString; |
15 } | 15 } |
16 | 16 |
17 namespace content { | 17 namespace content { |
18 | 18 |
19 // Method to get boolean value of constraint with |key| from constraints. | 19 // Method to get boolean value of constraint with |name| from constraints. |
20 // Returns true if the constraint is specified in either mandatory or optional | 20 // Returns true if the constraint is specified in either mandatory or optional |
21 // constraints. | 21 // constraints. |
22 bool CONTENT_EXPORT GetConstraintValueAsBoolean( | 22 bool CONTENT_EXPORT GetConstraintValueAsBoolean( |
23 const blink::WebMediaConstraints& constraints, | 23 const blink::WebMediaConstraints& constraints, |
24 const std::string& key, | 24 const std::string& name, |
25 bool* value); | 25 bool* value); |
26 | 26 |
27 // Method to get int value of constraint with |key| from constraints. | 27 // Method to get int value of constraint with |name| from constraints. |
28 // Returns true if the constraint is specified in either mandatory or Optional | 28 // Returns true if the constraint is specified in either mandatory or Optional |
29 // constraints. | 29 // constraints. |
30 bool CONTENT_EXPORT GetConstraintValueAsInteger( | 30 bool CONTENT_EXPORT GetConstraintValueAsInteger( |
31 const blink::WebMediaConstraints& constraints, | 31 const blink::WebMediaConstraints& constraints, |
32 const std::string& key, | 32 const std::string& name, |
33 int* value); | 33 int* value); |
34 | 34 |
35 // Method to get std::string value of constraint with |key| from constraints. | 35 // Method to get std::string value of constraint with |name| from constraints. |
36 // Returns true if the constraint is specified in either mandatory or Optional | 36 // Returns true if the constraint is specified in either mandatory or Optional |
37 // constraints. | 37 // constraints. |
38 bool CONTENT_EXPORT GetConstraintValueAsString( | 38 bool CONTENT_EXPORT GetConstraintValueAsString( |
39 const blink::WebMediaConstraints& constraints, | 39 const blink::WebMediaConstraints& constraints, |
40 const std::string& key, | 40 const std::string& name, |
41 std::string* value); | 41 std::string* value); |
42 | 42 |
43 // Method to get boolean value of constraint with |key| from the | 43 // Method to get boolean value of constraint with |name| from the |
44 // mandatory constraints. | 44 // mandatory constraints. |
45 bool CONTENT_EXPORT GetMandatoryConstraintValueAsBoolean( | 45 bool CONTENT_EXPORT GetMandatoryConstraintValueAsBoolean( |
46 const blink::WebMediaConstraints& constraints, | 46 const blink::WebMediaConstraints& constraints, |
47 const std::string& name, | 47 const std::string& name, |
48 bool* value); | 48 bool* value); |
49 | 49 |
50 // Method to get int value of constraint with |key| from the | 50 // Method to get int value of constraint with |name| from the |
51 // mandatory constraints. | 51 // mandatory constraints. |
52 bool CONTENT_EXPORT GetMandatoryConstraintValueAsInteger( | 52 bool CONTENT_EXPORT GetMandatoryConstraintValueAsInteger( |
53 const blink::WebMediaConstraints& constraints, | 53 const blink::WebMediaConstraints& constraints, |
54 const std::string& name, | 54 const std::string& name, |
55 int* value); | 55 int* value); |
56 | 56 |
57 // Method to get bool value of constraint with |key| from the | 57 // Method to get double value of constraint with |name| from the |
| 58 // mandatory constraints. |
| 59 bool CONTENT_EXPORT GetMandatoryConstraintValueAsDouble( |
| 60 const blink::WebMediaConstraints& constraints, |
| 61 const std::string& name, |
| 62 double* value); |
| 63 |
| 64 // Method to get bool value of constraint with |name| from the |
58 // optional constraints. | 65 // optional constraints. |
59 bool CONTENT_EXPORT GetOptionalConstraintValueAsBoolean( | 66 bool CONTENT_EXPORT GetOptionalConstraintValueAsBoolean( |
60 const blink::WebMediaConstraints& constraints, | 67 const blink::WebMediaConstraints& constraints, |
61 const std::string& name, | 68 const std::string& name, |
62 bool* value); | 69 bool* value); |
63 | 70 |
64 // Method to get int value of constraint with |key| from the | 71 // Method to get int value of constraint with |name| from the |
65 // optional constraints. | 72 // optional constraints. |
66 bool CONTENT_EXPORT GetOptionalConstraintValueAsInteger( | 73 bool CONTENT_EXPORT GetOptionalConstraintValueAsInteger( |
67 const blink::WebMediaConstraints& constraints, | 74 const blink::WebMediaConstraints& constraints, |
68 const std::string& name, | 75 const std::string& name, |
69 int* value); | 76 int* value); |
70 | 77 |
| 78 // Method to get double value of constraint with |name| from the |
| 79 // optional constraints. |
| 80 bool CONTENT_EXPORT GetOptionalConstraintValueAsDouble( |
| 81 const blink::WebMediaConstraints& constraints, |
| 82 const std::string& name, |
| 83 double* value); |
| 84 |
71 } // namespace content | 85 } // namespace content |
72 | 86 |
73 #endif // CONTENT_RENDERER_MEDIA_MEDIA_STREAM_CONSTRAINTS_UTIL_H_ | 87 #endif // CONTENT_RENDERER_MEDIA_MEDIA_STREAM_CONSTRAINTS_UTIL_H_ |
OLD | NEW |