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

Unified Diff: media/capture/video/win/video_capture_device_mf_win.cc

Issue 2121043002: 16 bpp video stream capture, render and WebGL usage - Realsense R200 & SR300 support. Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: Tests: cc, skcanvas_video_renderer, wrtcrecorder... Fake capture supports Y16. Created 4 years, 3 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: media/capture/video/win/video_capture_device_mf_win.cc
diff --git a/media/capture/video/win/video_capture_device_mf_win.cc b/media/capture/video/win/video_capture_device_mf_win.cc
index 9965e7c76a3fbd083c5661478d1015034b8a5cd9..920f67eae46e57e7e00915b8c8333e6ddb27c751 100644
--- a/media/capture/video/win/video_capture_device_mf_win.cc
+++ b/media/capture/video/win/video_capture_device_mf_win.cc
@@ -10,6 +10,7 @@
#include <utility>
+#include "base/big_endian.h"
#include "base/location.h"
#include "base/memory/ref_counted.h"
#include "base/strings/stringprintf.h"
@@ -178,6 +179,17 @@ bool VideoCaptureDeviceMFWin::FormatFromGuid(const GUID& guid,
return true;
}
}
+ // TODO(astojilj) Define GUIDs and move this to common place as the code is
+ // replicated around.
+ uint32_t fourcc;
+ base::ReadBigEndian(reinterpret_cast<const char*>(&guid.Data1), &fourcc);
+ if (fourcc == 'Z16 ' || fourcc == 'INVZ') {
+ *format = PIXEL_FORMAT_Y16;
+ return true;
+ } else if (fourcc == 'Y8 ') {
+ *format = PIXEL_FORMAT_Y8;
+ return true;
+ }
return false;
}

Powered by Google App Engine
This is Rietveld 408576698