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

Unified Diff: media/video/capture/file_video_capture_device.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: Added checks for unsupported pixel formats. Created 5 years, 10 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/file_video_capture_device.cc
diff --git a/media/video/capture/file_video_capture_device.cc b/media/video/capture/file_video_capture_device.cc
index 24673aa45934d824faba863e65c650c925587f19..46f89b5da3353e5f30fc8609fdbb8cb5a5fda122 100644
--- a/media/video/capture/file_video_capture_device.cc
+++ b/media/video/capture/file_video_capture_device.cc
@@ -10,6 +10,7 @@
#include "base/memory/scoped_ptr.h"
#include "base/strings/string_number_conversions.h"
#include "base/strings/string_piece.h"
+#include "media/video/capture/video_capture_types.h"
namespace media {
static const int kY4MHeaderMaxSize = 200;
@@ -169,10 +170,10 @@ void FileVideoCaptureDevice::StopAndDeAllocate() {
capture_thread_.Stop();
}
-int FileVideoCaptureDevice::CalculateFrameSize() {
+int FileVideoCaptureDevice::CalculateFrameSize() const {
DCHECK_EQ(capture_format_.pixel_format, PIXEL_FORMAT_I420);
DCHECK_EQ(capture_thread_.message_loop(), base::MessageLoop::current());
- return capture_format_.frame_size.GetArea() * 12 / 8;
+ return capture_format_.ImageAllocationSize();
}
void FileVideoCaptureDevice::OnAllocateAndStart(
« no previous file with comments | « media/video/capture/file_video_capture_device.h ('k') | media/video/capture/video_capture_device_unittest.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698