Index: third_party/WebKit/public/platform/WebMediaConstraints.h |
diff --git a/third_party/WebKit/public/platform/WebMediaConstraints.h b/third_party/WebKit/public/platform/WebMediaConstraints.h |
index b5175e973464936d2135f936efe5eaf1a2e291ac..17d2e1554c4c53baa58eeeaac6e5ad7519980d3b 100644 |
--- a/third_party/WebKit/public/platform/WebMediaConstraints.h |
+++ b/third_party/WebKit/public/platform/WebMediaConstraints.h |
@@ -236,23 +236,38 @@ private: |
unsigned m_hasExact : 1; |
}; |
+// This macro defines all the constraint names and their types. |
+// The expansion of CONSTRAINT_ITEM will depend on context. |
+#define CONSTRAINT_LIST \ |
+ CONSTRAINT_ITEM(width, Width, Long) \ |
+ CONSTRAINT_ITEM(height, Height, Long) \ |
+ CONSTRAINT_ITEM(aspectRatio, AspectRatio, Double) \ |
+ CONSTRAINT_ITEM(frameRate, FrameRate, Double) \ |
+ CONSTRAINT_ITEM(facingMode, FacingMode, String) \ |
+ CONSTRAINT_ITEM(volume, Volume, Double) \ |
+ CONSTRAINT_ITEM(sampleRate, SampleRate, Long) \ |
+ CONSTRAINT_ITEM(sampleSize, SampleSize, Long) \ |
+ CONSTRAINT_ITEM(echoCancellation, EchoCancellation, Boolean) \ |
+ CONSTRAINT_ITEM(latency, Latency, Double) \ |
+ CONSTRAINT_ITEM(channelCount, ChannelCount, Long) \ |
+ CONSTRAINT_ITEM(deviceId, DeviceId, String) \ |
+ CONSTRAINT_ITEM(groupId, GroupId, String) |
+// End of list. |
+// TODO(hta): Decide the future of the nonstandard constraints. |
+// If they go forward, they need to be added here. |
+// https://crbug.com/605673 |
+ |
struct WebMediaTrackConstraintSet { |
public: |
BLINK_PLATFORM_EXPORT WebMediaTrackConstraintSet(); |
+ bool dummy; // added purely for init-call reasons |
+#define CONSTRAINT_ITEM(lowercase, uppercase, datatype) \ |
+ datatype##Constraint lowercase; |
+ |
+ CONSTRAINT_LIST |
+ |
+#undef CONSTRAINT_ITEM |
- LongConstraint width; |
- LongConstraint height; |
- DoubleConstraint aspectRatio; |
- DoubleConstraint frameRate; |
- StringConstraint facingMode; |
- DoubleConstraint volume; |
- LongConstraint sampleRate; |
- LongConstraint sampleSize; |
- BooleanConstraint echoCancellation; |
- DoubleConstraint latency; |
- LongConstraint channelCount; |
- StringConstraint deviceId; |
- StringConstraint groupId; |
// Constraints not exposed in Blink at the moment, only through |
// the legacy name interface. |
StringConstraint mediaStreamSource; // tab, screen, desktop, system |