| Index: media/capture/video/win/sink_input_pin_win.cc
|
| diff --git a/media/capture/video/win/sink_input_pin_win.cc b/media/capture/video/win/sink_input_pin_win.cc
|
| index 0abd0a785c10cc83c3969d8de5f29502ec72f01a..391af9b9e177a6f3d324d4969fc7404cbc89a8da 100644
|
| --- a/media/capture/video/win/sink_input_pin_win.cc
|
| +++ b/media/capture/video/win/sink_input_pin_win.cc
|
| @@ -11,6 +11,7 @@
|
| #include <dshow.h>
|
| #include <stdint.h>
|
|
|
| +#include "base/big_endian.h"
|
| #include "base/logging.h"
|
| #include "base/macros.h"
|
| #include "media/base/timestamp_constants.h"
|
| @@ -96,6 +97,21 @@ bool SinkInputPin::IsMediaTypeValid(const AM_MEDIA_TYPE* media_type) {
|
| return true;
|
| }
|
|
|
| + if (sub_type.Data1 == pvi->bmiHeader.biCompression) {
|
| + // 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*>(&sub_type.Data1),
|
| + &fourcc);
|
| + if (fourcc == 'Z16 ' || fourcc == 'INVZ') {
|
| + resulting_format_.pixel_format = PIXEL_FORMAT_Y16;
|
| + return true;
|
| + } else if (fourcc == 'Y8 ') {
|
| + resulting_format_.pixel_format = PIXEL_FORMAT_Y8;
|
| + return true;
|
| + }
|
| + }
|
| +
|
| #ifndef NDEBUG
|
| WCHAR guid_str[128];
|
| StringFromGUID2(sub_type, guid_str, arraysize(guid_str));
|
| @@ -123,8 +139,11 @@ bool SinkInputPin::GetValidMediaType(int index, AM_MEDIA_TYPE* media_type) {
|
| media_type->formattype = FORMAT_VideoInfo;
|
| media_type->bTemporalCompression = FALSE;
|
|
|
| - if (requested_pixel_format_ == PIXEL_FORMAT_MJPEG) {
|
| + if (requested_pixel_format_ == PIXEL_FORMAT_MJPEG ||
|
| + requested_pixel_format_ == PIXEL_FORMAT_Y8 ||
|
| + requested_pixel_format_ == PIXEL_FORMAT_Y16) {
|
| // If the requested pixel format is MJPEG, accept only MJPEG.
|
| + // If the requested pixel format is Y16 or Y8, accept only those.
|
| // This is ok since the capabilities of the capturer have been
|
| // enumerated and we know that it is supported.
|
| if (index != 0)
|
|
|