Chromium Code Reviews
chromiumcodereview-hr@appspot.gserviceaccount.com (chromiumcodereview-hr) | Please choose your nickname with Settings | Help | Chromium Project | Gerrit Changes | Sign out
(660)

Unified Diff: third_party/WebKit/public/platform/WebMediaConstraints.h

Issue 1899943008: Macro-based constraints Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: Added a fourth macro application Created 4 years, 8 months ago
Use n/p to move between diff chunks; N/P to move between comments. Draft comments are only viewable by you.
Jump to:
View side-by-side diff with in-line comments
Download patch
« no previous file with comments | « third_party/WebKit/Source/platform/exported/WebMediaConstraints.cpp ('k') | no next file » | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
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
« no previous file with comments | « third_party/WebKit/Source/platform/exported/WebMediaConstraints.cpp ('k') | no next file » | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698