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
3 // found in the LICENSE file.
5 #ifndef CONTENT_RENDERER_MEDIA_MEDIA_STREAM_CONSTRAINTS_UTIL_H_
6 #define CONTENT_RENDERER_MEDIA_MEDIA_STREAM_CONSTRAINTS_UTIL_H_
10 #include "content/common/content_export.h"
13 class WebMediaConstraints
;
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
22 bool CONTENT_EXPORT
GetConstraintValueAsBoolean(
23 const blink::WebMediaConstraints
& constraints
,
24 const std::string
& name
,
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
30 bool CONTENT_EXPORT
GetConstraintValueAsInteger(
31 const blink::WebMediaConstraints
& constraints
,
32 const std::string
& name
,
35 // Method to get double precision value of constraint with |name| from
36 // constraints. Returns true if the constraint is specified in either mandatory
37 // or Optional constraints.
38 bool CONTENT_EXPORT
GetConstraintValueAsDouble(
39 const blink::WebMediaConstraints
& constraints
,
40 const std::string
& name
,
43 // Method to get std::string value of constraint with |name| from constraints.
44 // Returns true if the constraint is specified in either mandatory or Optional
46 bool CONTENT_EXPORT
GetConstraintValueAsString(
47 const blink::WebMediaConstraints
& constraints
,
48 const std::string
& name
,
51 // Method to get boolean value of constraint with |name| from the
52 // mandatory constraints.
53 bool CONTENT_EXPORT
GetMandatoryConstraintValueAsBoolean(
54 const blink::WebMediaConstraints
& constraints
,
55 const std::string
& name
,
58 // Method to get int value of constraint with |name| from the
59 // mandatory constraints.
60 bool CONTENT_EXPORT
GetMandatoryConstraintValueAsInteger(
61 const blink::WebMediaConstraints
& constraints
,
62 const std::string
& name
,
65 // Method to get double value of constraint with |name| from the
66 // mandatory constraints.
67 bool CONTENT_EXPORT
GetMandatoryConstraintValueAsDouble(
68 const blink::WebMediaConstraints
& constraints
,
69 const std::string
& name
,
72 // Method to get bool value of constraint with |name| from the
73 // optional constraints.
74 bool CONTENT_EXPORT
GetOptionalConstraintValueAsBoolean(
75 const blink::WebMediaConstraints
& constraints
,
76 const std::string
& name
,
79 // Method to get int value of constraint with |name| from the
80 // optional constraints.
81 bool CONTENT_EXPORT
GetOptionalConstraintValueAsInteger(
82 const blink::WebMediaConstraints
& constraints
,
83 const std::string
& name
,
86 // Method to get double value of constraint with |name| from the
87 // optional constraints.
88 bool CONTENT_EXPORT
GetOptionalConstraintValueAsDouble(
89 const blink::WebMediaConstraints
& constraints
,
90 const std::string
& name
,
93 } // namespace content
95 #endif // CONTENT_RENDERER_MEDIA_MEDIA_STREAM_CONSTRAINTS_UTIL_H_