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

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: Changed function to a public member. Added tests. 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..1ff34478a7d71ca1ef109afd2ae4c4874c432f06 100644
--- a/media/video/capture/win/sink_input_pin_win.cc
+++ b/media/video/capture/win/sink_input_pin_win.cc
@@ -52,7 +52,7 @@ bool SinkInputPin::GetValidMediaType(int index, AM_MEDIA_TYPE* media_type) {
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;
+ requested_format_.ImageAllocationSize();
mcasas 2015/02/03 20:48:46 Doesn't this fit in one line? Same for the other c
media_type->subtype = kMediaSubTypeI420;
break;
}
@@ -61,7 +61,8 @@ 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 +71,8 @@ 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 +81,8 @@ 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.h ('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