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

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: GetVideoKindForFormat moved to utility. thanks guidou@. 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..0c2dd59b692138b91ee979af7aa23f469aa704df 100644
--- a/content/renderer/media/media_stream_video_source.cc
+++ b/content/renderer/media/media_stream_video_source.cc
@@ -13,6 +13,7 @@
#include "base/strings/string_number_conversions.h"
#include "base/trace_event/trace_event.h"
#include "content/child/child_process.h"
+#include "content/renderer/media/media_stream_constraints_util_video_source.h"
#include "content/renderer/media/media_stream_video_track.h"
#include "content/renderer/media/video_track_adapter.h"
@@ -28,7 +29,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 +144,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