OLD | NEW |
1 /* | 1 /* |
2 * Copyright (C) 2012 Google Inc. All rights reserved. | 2 * Copyright (C) 2012 Google Inc. All rights reserved. |
3 * | 3 * |
4 * Redistribution and use in source and binary forms, with or without | 4 * Redistribution and use in source and binary forms, with or without |
5 * modification, are permitted provided that the following conditions are | 5 * modification, are permitted provided that the following conditions are |
6 * met: | 6 * met: |
7 * | 7 * |
8 * * Redistributions of source code must retain the above copyright | 8 * * Redistributions of source code must retain the above copyright |
9 * notice, this list of conditions and the following disclaimer. | 9 * notice, this list of conditions and the following disclaimer. |
10 * * Redistributions in binary form must reproduce the above | 10 * * Redistributions in binary form must reproduce the above |
(...skipping 80 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
91 long m_exact; | 91 long m_exact; |
92 long m_ideal; | 92 long m_ideal; |
93 unsigned m_hasMin : 1; | 93 unsigned m_hasMin : 1; |
94 unsigned m_hasMax : 1; | 94 unsigned m_hasMax : 1; |
95 unsigned m_hasExact : 1; | 95 unsigned m_hasExact : 1; |
96 unsigned m_hasIdeal : 1; | 96 unsigned m_hasIdeal : 1; |
97 }; | 97 }; |
98 | 98 |
99 class BLINK_PLATFORM_EXPORT DoubleConstraint : public BaseConstraint { | 99 class BLINK_PLATFORM_EXPORT DoubleConstraint : public BaseConstraint { |
100 public: | 100 public: |
101 // Permit a certain leeway when comparing floats. | 101 // Permit a certain leeway when comparing floats. The offset of 0.00001 |
102 // The offset of 0.00001 is chosen based on observed behavior of | 102 // is chosen based on observed behavior of doubles formatted with |
103 // doubles formatted with rtc::ToString. | 103 // rtc::ToString. |
104 static double kConstraintEpsilon; | 104 static const double kConstraintEpsilon; |
105 | 105 |
106 explicit DoubleConstraint(const char* name); | 106 explicit DoubleConstraint(const char* name); |
107 | 107 |
108 void setMin(double value) | 108 void setMin(double value) |
109 { | 109 { |
110 m_min = value; | 110 m_min = value; |
111 m_hasMin = true; | 111 m_hasMin = true; |
112 } | 112 } |
113 | 113 |
114 void setMax(double value) | 114 void setMax(double value) |
(...skipping 200 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
315 BLINK_PLATFORM_EXPORT const WebMediaTrackConstraintSet& basic() const; | 315 BLINK_PLATFORM_EXPORT const WebMediaTrackConstraintSet& basic() const; |
316 BLINK_PLATFORM_EXPORT const WebVector<WebMediaTrackConstraintSet>& advanced(
) const; | 316 BLINK_PLATFORM_EXPORT const WebVector<WebMediaTrackConstraintSet>& advanced(
) const; |
317 | 317 |
318 private: | 318 private: |
319 WebPrivatePtr<WebMediaConstraintsPrivate> m_private; | 319 WebPrivatePtr<WebMediaConstraintsPrivate> m_private; |
320 }; | 320 }; |
321 | 321 |
322 } // namespace blink | 322 } // namespace blink |
323 | 323 |
324 #endif // WebMediaConstraints_h | 324 #endif // WebMediaConstraints_h |
OLD | NEW |