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 a5e7735ecd8ff3335c4b59465ef829c55de39a25..351fd7f74835451418049a9797c10f67d192a849 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" |
@@ -184,6 +185,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; |
} |