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

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

Issue 2398463003: 16 bit capture and GPU&CPU memory buffer support.
Patch Set: fixes. Created 4 years, 2 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/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..7fdefce609f4aa895ca211d1d97f15d0f9714d30 100644
--- a/media/capture/video/win/sink_input_pin_win.cc
+++ b/media/capture/video/win/sink_input_pin_win.cc
@@ -14,6 +14,7 @@
#include "base/logging.h"
#include "base/macros.h"
#include "media/base/timestamp_constants.h"
+#include "media/capture/video/video_capture_utils.h"
namespace media {
@@ -95,6 +96,12 @@ bool SinkInputPin::IsMediaTypeValid(const AM_MEDIA_TYPE* media_type) {
resulting_format_.pixel_format = PIXEL_FORMAT_RGB32;
return true;
}
+ if (sub_type.Data1 == pvi->bmiHeader.biCompression) {
+ if (IsY16FormatFourCc(sub_type.Data1)) {
+ resulting_format_.pixel_format = PIXEL_FORMAT_Y16;
+ return true;
+ }
+ }
#ifndef NDEBUG
WCHAR guid_str[128];
@@ -123,8 +130,9 @@ 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 the requested pixel format is MJPEG, accept only MJPEG.
+ if (requested_pixel_format_ == PIXEL_FORMAT_MJPEG ||
+ requested_pixel_format_ == PIXEL_FORMAT_Y16) {
+ // If the requested pixel format is MJPEG or Y16, don't accept other.
// This is ok since the capabilities of the capturer have been
// enumerated and we know that it is supported.
if (index != 0)
« no previous file with comments | « media/capture/video/video_capture_utils.cc ('k') | media/capture/video/win/video_capture_device_factory_win.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698