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

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

Issue 1036063002: MEDIASUBTYPE_RGB32 support for Windows (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: Fallback in switch statement. Created 5 years, 9 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
« no previous file with comments | « media/base/video_capture_types.cc ('k') | media/video/capture/win/video_capture_device_win.cc » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: media/video/capture/win/sink_input_pin_win.cc
diff --git a/media/video/capture/win/sink_input_pin_win.cc b/media/video/capture/win/sink_input_pin_win.cc
index 08e76a72792d0f488cf970373c18f4b22114e3f5..8e52ebae0ef1bebd5831eaf6834527005112d4f8 100644
--- a/media/video/capture/win/sink_input_pin_win.cc
+++ b/media/video/capture/win/sink_input_pin_win.cc
@@ -90,6 +90,15 @@ bool SinkInputPin::GetValidMediaType(int index, AM_MEDIA_TYPE* media_type) {
media_type->subtype = MEDIASUBTYPE_RGB24;
break;
}
+ case 3: {
+ pvi->bmiHeader.biCompression = BI_RGB;
+ pvi->bmiHeader.biBitCount = 32;
+ pvi->bmiHeader.biWidth = requested_info_header_.biWidth;
+ pvi->bmiHeader.biHeight = requested_info_header_.biHeight;
+ pvi->bmiHeader.biSizeImage = GetArea(requested_info_header_) * 4;
+ media_type->subtype = MEDIASUBTYPE_RGB32;
+ break;
+ }
default:
return false;
}
@@ -127,22 +136,27 @@ bool SinkInputPin::IsMediaTypeValid(const AM_MEDIA_TYPE* media_type) {
if (sub_type == kMediaSubTypeI420 &&
pvi->bmiHeader.biCompression == MAKEFOURCC('I', '4', '2', '0')) {
resulting_format_.pixel_format = PIXEL_FORMAT_I420;
- return true; // This format is acceptable.
+ return true;
}
if (sub_type == MEDIASUBTYPE_YUY2 &&
pvi->bmiHeader.biCompression == MAKEFOURCC('Y', 'U', 'Y', '2')) {
resulting_format_.pixel_format = PIXEL_FORMAT_YUY2;
- return true; // This format is acceptable.
+ return true;
}
if (sub_type == MEDIASUBTYPE_MJPG &&
pvi->bmiHeader.biCompression == MAKEFOURCC('M', 'J', 'P', 'G')) {
resulting_format_.pixel_format = PIXEL_FORMAT_MJPEG;
- return true; // This format is acceptable.
+ return true;
}
if (sub_type == MEDIASUBTYPE_RGB24 &&
pvi->bmiHeader.biCompression == BI_RGB) {
resulting_format_.pixel_format = PIXEL_FORMAT_RGB24;
- return true; // This format is acceptable.
+ return true;
+ }
+ if (sub_type == MEDIASUBTYPE_RGB32 &&
+ pvi->bmiHeader.biCompression == BI_RGB) {
+ resulting_format_.pixel_format = PIXEL_FORMAT_RGB32;
+ return true;
}
return false;
}
« no previous file with comments | « media/base/video_capture_types.cc ('k') | media/video/capture/win/video_capture_device_win.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698