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 218 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
229 bool hasExact() const { return m_hasExact; } | 229 bool hasExact() const { return m_hasExact; } |
230 bool hasIdeal() const { return m_hasIdeal; } | 230 bool hasIdeal() const { return m_hasIdeal; } |
231 | 231 |
232 private: | 232 private: |
233 unsigned m_ideal : 1; | 233 unsigned m_ideal : 1; |
234 unsigned m_exact : 1; | 234 unsigned m_exact : 1; |
235 unsigned m_hasIdeal : 1; | 235 unsigned m_hasIdeal : 1; |
236 unsigned m_hasExact : 1; | 236 unsigned m_hasExact : 1; |
237 }; | 237 }; |
238 | 238 |
| 239 // This macro defines all the constraint names and their types. |
| 240 // The expansion of CONSTRAINT_ITEM will depend on context. |
| 241 #define CONSTRAINT_LIST \ |
| 242 CONSTRAINT_ITEM(width, Width, Long) \ |
| 243 CONSTRAINT_ITEM(height, Height, Long) \ |
| 244 CONSTRAINT_ITEM(aspectRatio, AspectRatio, Double) \ |
| 245 CONSTRAINT_ITEM(frameRate, FrameRate, Double) \ |
| 246 CONSTRAINT_ITEM(facingMode, FacingMode, String) \ |
| 247 CONSTRAINT_ITEM(volume, Volume, Double) \ |
| 248 CONSTRAINT_ITEM(sampleRate, SampleRate, Long) \ |
| 249 CONSTRAINT_ITEM(sampleSize, SampleSize, Long) \ |
| 250 CONSTRAINT_ITEM(echoCancellation, EchoCancellation, Boolean) \ |
| 251 CONSTRAINT_ITEM(latency, Latency, Double) \ |
| 252 CONSTRAINT_ITEM(channelCount, ChannelCount, Long) \ |
| 253 CONSTRAINT_ITEM(deviceId, DeviceId, String) \ |
| 254 CONSTRAINT_ITEM(groupId, GroupId, String) |
| 255 // End of list. |
| 256 // TODO(hta): Decide the future of the nonstandard constraints. |
| 257 // If they go forward, they need to be added here. |
| 258 // https://crbug.com/605673 |
| 259 |
239 struct WebMediaTrackConstraintSet { | 260 struct WebMediaTrackConstraintSet { |
240 public: | 261 public: |
241 BLINK_PLATFORM_EXPORT WebMediaTrackConstraintSet(); | 262 BLINK_PLATFORM_EXPORT WebMediaTrackConstraintSet(); |
| 263 bool dummy; // added purely for init-call reasons |
| 264 #define CONSTRAINT_ITEM(lowercase, uppercase, datatype) \ |
| 265 datatype##Constraint lowercase; |
242 | 266 |
243 LongConstraint width; | 267 CONSTRAINT_LIST |
244 LongConstraint height; | 268 |
245 DoubleConstraint aspectRatio; | 269 #undef CONSTRAINT_ITEM |
246 DoubleConstraint frameRate; | 270 |
247 StringConstraint facingMode; | |
248 DoubleConstraint volume; | |
249 LongConstraint sampleRate; | |
250 LongConstraint sampleSize; | |
251 BooleanConstraint echoCancellation; | |
252 DoubleConstraint latency; | |
253 LongConstraint channelCount; | |
254 StringConstraint deviceId; | |
255 StringConstraint groupId; | |
256 // Constraints not exposed in Blink at the moment, only through | 271 // Constraints not exposed in Blink at the moment, only through |
257 // the legacy name interface. | 272 // the legacy name interface. |
258 StringConstraint mediaStreamSource; // tab, screen, desktop, system | 273 StringConstraint mediaStreamSource; // tab, screen, desktop, system |
259 BooleanConstraint renderToAssociatedSink; | 274 BooleanConstraint renderToAssociatedSink; |
260 BooleanConstraint hotwordEnabled; | 275 BooleanConstraint hotwordEnabled; |
261 BooleanConstraint googEchoCancellation; | 276 BooleanConstraint googEchoCancellation; |
262 BooleanConstraint googExperimentalEchoCancellation; | 277 BooleanConstraint googExperimentalEchoCancellation; |
263 BooleanConstraint googAutoGainControl; | 278 BooleanConstraint googAutoGainControl; |
264 BooleanConstraint googExperimentalAutoGainControl; | 279 BooleanConstraint googExperimentalAutoGainControl; |
265 BooleanConstraint googNoiseSuppression; | 280 BooleanConstraint googNoiseSuppression; |
(...skipping 66 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
332 | 347 |
333 BLINK_PLATFORM_EXPORT const WebString toString() const; | 348 BLINK_PLATFORM_EXPORT const WebString toString() const; |
334 | 349 |
335 private: | 350 private: |
336 WebPrivatePtr<WebMediaConstraintsPrivate> m_private; | 351 WebPrivatePtr<WebMediaConstraintsPrivate> m_private; |
337 }; | 352 }; |
338 | 353 |
339 } // namespace blink | 354 } // namespace blink |
340 | 355 |
341 #endif // WebMediaConstraints_h | 356 #endif // WebMediaConstraints_h |
OLD | NEW |