summaryrefslogtreecommitdiffstats
path: root/content/renderer/media/media_stream_constraints_util.h
blob: 71e9a492d183fbc3710f57e46da79f55b96f3ec5 (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
// 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>

#include "content/common/content_export.h"

namespace blink {
class WebMediaConstraints;
class WebString;
}

namespace content {

// Method to get boolean value of constraint with |name| from constraints.
// Returns true if the constraint is specified in either mandatory or optional
// constraints.
bool CONTENT_EXPORT GetConstraintValueAsBoolean(
    const blink::WebMediaConstraints& constraints,
    const std::string& name,
    bool* value);

// Method to get int value of constraint with |name| from constraints.
// Returns true if the constraint is specified in either mandatory or Optional
// constraints.
bool CONTENT_EXPORT GetConstraintValueAsInteger(
    const blink::WebMediaConstraints& constraints,
    const std::string& name,
    int* value);

// Method to get double precision value of constraint with |name| from
// constraints. Returns true if the constraint is specified in either mandatory
// or Optional constraints.
bool CONTENT_EXPORT GetConstraintValueAsDouble(
    const blink::WebMediaConstraints& constraints,
    const std::string& name,
    double* value);

// Method to get std::string value of constraint with |name| from constraints.
// Returns true if the constraint is specified in either mandatory or Optional
// constraints.
bool CONTENT_EXPORT GetConstraintValueAsString(
    const blink::WebMediaConstraints& constraints,
    const std::string& name,
    std::string* value);

// Method to get boolean value of constraint with |name| from the
// mandatory constraints.
bool CONTENT_EXPORT GetMandatoryConstraintValueAsBoolean(
    const blink::WebMediaConstraints& constraints,
    const std::string& name,
    bool* value);

// Method to get int value of constraint with |name| from the
// mandatory constraints.
bool CONTENT_EXPORT GetMandatoryConstraintValueAsInteger(
    const blink::WebMediaConstraints& constraints,
    const std::string& name,
    int* value);

// Method to get double value of constraint with |name| from the
// mandatory constraints.
bool CONTENT_EXPORT GetMandatoryConstraintValueAsDouble(
    const blink::WebMediaConstraints& constraints,
    const std::string& name,
    double* value);

// Method to get bool value of constraint with |name| from the
// optional constraints.
bool CONTENT_EXPORT GetOptionalConstraintValueAsBoolean(
    const blink::WebMediaConstraints& constraints,
    const std::string& name,
    bool* value);

// Method to get int value of constraint with |name| from the
// optional constraints.
bool CONTENT_EXPORT GetOptionalConstraintValueAsInteger(
    const blink::WebMediaConstraints& constraints,
    const std::string& name,
    int* value);

// Method to get double value of constraint with |name| from the
// optional constraints.
bool CONTENT_EXPORT GetOptionalConstraintValueAsDouble(
    const blink::WebMediaConstraints& constraints,
    const std::string& name,
    double* value);

}  // namespace content

#endif  // CONTENT_RENDERER_MEDIA_MEDIA_STREAM_CONSTRAINTS_UTIL_H_