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

Unified Diff: content/renderer/media/media_stream_video_source.cc

Issue 2664673002: Media Capture Depth Stream Extensions API: videoKind settings and constraint. (Closed)
Patch Set: videoKind string constants removed from header. Created 3 years, 10 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
Index: content/renderer/media/media_stream_video_source.cc
diff --git a/content/renderer/media/media_stream_video_source.cc b/content/renderer/media/media_stream_video_source.cc
index 759e6213960d07c8daf12bacb0245514a773d069..54a62f8197653731baa6e4f8a469543b709c1db7 100644
--- a/content/renderer/media/media_stream_video_source.cc
+++ b/content/renderer/media/media_stream_video_source.cc
@@ -28,7 +28,8 @@ const char* const kLegalVideoConstraints[] = {"width",
"deviceId",
"groupId",
"mediaStreamSource",
- "googNoiseReduction"};
+ "googNoiseReduction",
+ "videoKind"};
// Returns true if |constraint| has mandatory constraints.
bool HasMandatoryConstraints(const blink::WebMediaConstraints& constraints) {
@@ -142,6 +143,9 @@ bool UpdateFormatForConstraints(
(constraints.height.hasExact() &&
constraints.height.exact() > format->frame_size.height())) {
*failing_constraint_name = constraints.height.name();
+ } else if (constraints.videoKind.hasExact() &&
+ !constraints.videoKind.matches(GetVideoKindForFormat(*format))) {
+ *failing_constraint_name = constraints.videoKind.name();
} else if (!constraints.frameRate.matches(format->frame_rate)) {
if (constraints.frameRate.hasMax()) {
const double value = constraints.frameRate.max();

Powered by Google App Engine
This is Rietveld 408576698