Index: third_party/WebKit/Source/modules/mediastream/MediaConstraintsImpl.cpp |
diff --git a/third_party/WebKit/Source/modules/mediastream/MediaConstraintsImpl.cpp b/third_party/WebKit/Source/modules/mediastream/MediaConstraintsImpl.cpp |
index 24262199521b02c5a0611fcaaf55b9a42ba4f654..26fc2ed694bb4b05a3abbae6e43da04aa912ddca 100644 |
--- a/third_party/WebKit/Source/modules/mediastream/MediaConstraintsImpl.cpp |
+++ b/third_party/WebKit/Source/modules/mediastream/MediaConstraintsImpl.cpp |
@@ -513,45 +513,15 @@ void copyBooleanConstraint(const ConstrainBooleanParameters& blinkForm, BooleanC |
void copyConstraints(const MediaTrackConstraintSet& constraintsIn, WebMediaTrackConstraintSet& constraintBuffer) |
{ |
- if (constraintsIn.hasWidth()) { |
- copyLongConstraint(constraintsIn.width(), constraintBuffer.width); |
- } |
- if (constraintsIn.hasHeight()) { |
- copyLongConstraint(constraintsIn.height(), constraintBuffer.height); |
- } |
- if (constraintsIn.hasAspectRatio()) { |
- copyDoubleConstraint(constraintsIn.aspectRatio(), constraintBuffer.aspectRatio); |
- } |
- if (constraintsIn.hasFrameRate()) { |
- copyDoubleConstraint(constraintsIn.frameRate(), constraintBuffer.frameRate); |
- } |
- if (constraintsIn.hasFacingMode()) { |
- copyStringConstraint(constraintsIn.facingMode(), constraintBuffer.facingMode); |
- } |
- if (constraintsIn.hasVolume()) { |
- copyDoubleConstraint(constraintsIn.volume(), constraintBuffer.volume); |
- } |
- if (constraintsIn.hasSampleRate()) { |
- copyLongConstraint(constraintsIn.sampleRate(), constraintBuffer.sampleRate); |
- } |
- if (constraintsIn.hasSampleSize()) { |
- copyLongConstraint(constraintsIn.sampleSize(), constraintBuffer.sampleSize); |
- } |
- if (constraintsIn.hasEchoCancellation()) { |
- copyBooleanConstraint(constraintsIn.echoCancellation(), constraintBuffer.echoCancellation); |
- } |
- if (constraintsIn.hasLatency()) { |
- copyDoubleConstraint(constraintsIn.latency(), constraintBuffer.latency); |
- } |
- if (constraintsIn.hasChannelCount()) { |
- copyLongConstraint(constraintsIn.channelCount(), constraintBuffer.channelCount); |
- } |
- if (constraintsIn.hasDeviceId()) { |
- copyStringConstraint(constraintsIn.deviceId(), constraintBuffer.deviceId); |
- } |
- if (constraintsIn.hasGroupId()) { |
- copyStringConstraint(constraintsIn.groupId(), constraintBuffer.groupId); |
+ |
+#define CONSTRAINT_ITEM(lowercase, uppercase, datatype) \ |
+ if (constraintsIn.has##uppercase()) { \ |
tommi (sloooow) - chröme
2016/05/01 17:52:16
crazy question. Instead of all of these type spec
hta - Chromium
2016/05/02 08:22:00
two problems with that:
- the constraints types a
tommi (sloooow) - chröme
2016/05/03 16:49:34
What I'm wondering is if it would make more sense
|
+ copy##datatype##Constraint(constraintsIn.lowercase(), constraintBuffer.lowercase); \ |
} |
+ |
+ CONSTRAINT_LIST |
+ |
+#undef CONSTRAINT_ITEM |
} |
WebMediaConstraints create(ExecutionContext* context, const MediaTrackConstraints& constraintsIn, MediaErrorState& errorState) |