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

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

Issue 897483002: Refactored pixel format resize operations in media/video/capture into a function called VideoCaptu… (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: Fixed operator spacing. Created 5 years, 11 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/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 bf2a247a8381150a7117e03986277261f5773c32..9330f91d45afafc5a6dabfd48669ca6404214faa 100644
--- a/media/video/capture/win/sink_input_pin_win.cc
+++ b/media/video/capture/win/sink_input_pin_win.cc
@@ -51,8 +51,7 @@ bool SinkInputPin::GetValidMediaType(int index, AM_MEDIA_TYPE* media_type) {
pvi->bmiHeader.biBitCount = 12; // bit per pixel
pvi->bmiHeader.biWidth = requested_format_.frame_size.width();
pvi->bmiHeader.biHeight = requested_format_.frame_size.height();
- pvi->bmiHeader.biSizeImage =
- requested_format_.frame_size.GetArea() * 3 / 2;
+ pvi->bmiHeader.biSizeImage = requested_format_.ImageAllocationSize();
media_type->subtype = kMediaSubTypeI420;
break;
}
@@ -61,7 +60,7 @@ bool SinkInputPin::GetValidMediaType(int index, AM_MEDIA_TYPE* media_type) {
pvi->bmiHeader.biBitCount = 16;
pvi->bmiHeader.biWidth = requested_format_.frame_size.width();
pvi->bmiHeader.biHeight = requested_format_.frame_size.height();
- pvi->bmiHeader.biSizeImage = requested_format_.frame_size.GetArea() * 2;
+ pvi->bmiHeader.biSizeImage = requested_format_.ImageAllocationSize();
media_type->subtype = MEDIASUBTYPE_YUY2;
break;
}
@@ -70,7 +69,7 @@ bool SinkInputPin::GetValidMediaType(int index, AM_MEDIA_TYPE* media_type) {
pvi->bmiHeader.biBitCount = 0;
pvi->bmiHeader.biWidth = requested_format_.frame_size.width();
pvi->bmiHeader.biHeight = requested_format_.frame_size.height();
- pvi->bmiHeader.biSizeImage = 0;
+ pvi->bmiHeader.biSizeImage = requested_format_.ImageAllocationSize();
media_type->subtype = MEDIASUBTYPE_MJPG;
break;
}
@@ -79,7 +78,7 @@ bool SinkInputPin::GetValidMediaType(int index, AM_MEDIA_TYPE* media_type) {
pvi->bmiHeader.biBitCount = 24;
pvi->bmiHeader.biWidth = requested_format_.frame_size.width();
pvi->bmiHeader.biHeight = requested_format_.frame_size.height();
- pvi->bmiHeader.biSizeImage = requested_format_.frame_size.GetArea() * 3;
+ pvi->bmiHeader.biSizeImage = requested_format_.ImageAllocationSize();
media_type->subtype = MEDIASUBTYPE_RGB24;
break;
}
« media/video/capture/video_capture_types.cc ('K') | « media/video/capture/video_capture_types.cc ('k') | no next file » | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698