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

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: 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_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(
Guido Urdaneta 2017/02/10 15:36:17 nit: I still would prefer the function to be in me
aleksandar.stojiljkovic 2017/02/10 16:29:23 Done.
+ 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:
« no previous file with comments | « content/renderer/media/media_stream_video_track.h ('k') | content/test/data/media/depth_stream_test_utilities.js » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698