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

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

Issue 2664673002: Media Capture Depth Stream Extensions API: videoKind settings and constraint. (Closed)
Patch Set: Rebase to http://crrev.com/2669243004/ simplified the patch. Thanks guidou@chromium.org 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_track.cc
diff --git a/content/renderer/media/media_stream_video_track.cc b/content/renderer/media/media_stream_video_track.cc
index 23e0ab95913510e0783918533d252a97b589a764..c18283c3220f8fe1d0d866d76783aa1f522f4f3f 100644
--- a/content/renderer/media/media_stream_video_track.cc
+++ b/content/renderer/media/media_stream_video_track.cc
@@ -14,6 +14,16 @@
namespace content {
+const char kVideoKindColor[] = "color";
+const char kVideoKindDepth[] = "depth";
+
+blink::WebString GetVideoKindForFormat(
+ const media::VideoCaptureFormat& format) {
+ return (format.pixel_format == media::PIXEL_FORMAT_Y16)
+ ? blink::WebString::fromASCII(kVideoKindDepth)
+ : blink::WebString::fromASCII(kVideoKindColor);
+}
+
namespace {
void ResetCallback(std::unique_ptr<VideoCaptureDeliverFrameCB> callback) {
// |callback| will be deleted when this exits.
@@ -311,6 +321,7 @@ void MediaStreamVideoTrack::getSettings(
settings.frameRate = format->frame_rate;
settings.width = format->frame_size.width();
settings.height = format->frame_size.height();
+ settings.videoKind = GetVideoKindForFormat(*format);
}
switch (source_->device_info().device.video_facing) {
case media::MEDIA_VIDEO_FACING_NONE:

Powered by Google App Engine
This is Rietveld 408576698